From 73cfd7ef9bb515843c5cd92fa5e3f14b30421775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=96=B9=E6=88=90?= Date: Sun, 28 Dec 2025 11:36:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD=E5=B9=B6=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E4=BB=A5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=92=8C=E7=9F=AD=E4=BF=A1=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/appUser.js | 25 ++ pages/login/index.vue | 856 +++++++++++++++++++++++++++--------------- 2 files changed, 572 insertions(+), 309 deletions(-) diff --git a/api/appUser.js b/api/appUser.js index bfb4284..a2e9142 100644 --- a/api/appUser.js +++ b/api/appUser.js @@ -5,6 +5,31 @@ export function wechatLogin(code, invite_code) { return request({ url: '/api/app/users/weixin/login', method: 'POST', data }) } +// ============================================ +// 短信登录 API +// ============================================ + +/** + * 发送短信验证码 + * @param {string} mobile - 手机号 + */ +export function sendSmsCode(mobile) { + return request({ url: '/api/app/sms/send-code', method: 'POST', data: { mobile } }) +} + +/** + * 短信验证码登录 + * @param {string} mobile - 手机号 + * @param {string} code - 验证码 + * @param {string} invite_code - 可选邀请码 + */ +export function smsLogin(mobile, code, invite_code) { + const data = { mobile, code } + if (invite_code) data.invite_code = invite_code + return request({ url: '/api/app/sms/login', method: 'POST', data }) +} + + export function getInventory(user_id, page = 1, page_size = 20, params = {}) { return authRequest({ url: `/api/app/users/${user_id}/inventory`, method: 'GET', data: { page, page_size, ...params } }) } diff --git a/pages/login/index.vue b/pages/login/index.vue index 558b33c..8f57a72 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -1,201 +1,327 @@