feat: 添加短信登录功能并重构登录页面以支持微信和短信登录方式
This commit is contained in:
parent
3175c6e8ae
commit
73cfd7ef9b
@ -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 } })
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user