更新
This commit is contained in:
1 parent
012f8edf8b
commit
36ff960fbd
33 files changed
+1644
-344
No files matched your search
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* 游客轻身份接口(后端 controllers/guest.go)
|
||||
* 失败均由调用方静默处理,不弹全局 toast。
|
||||
*/
|
||||
import { request } from '@/api/request.js'
|
||||
|
||||
/**
|
||||
* 游客登录:微信手机号动态凭证换游客令牌
|
||||
* @param {{ code: string, phoneCode: string, appid?: string }} params code=uni.login 的登录凭证
|
||||
* @returns {Promise<{ token: string, guest_id: number, phone_mask: string, expires_in: number }>}
|
||||
*/
|
||||
export function guestMiniLogin({ code = '', phoneCode = '', appid = '' } = {}) {
|
||||
return request({
|
||||
url: '/api/guest/mini-login',
|
||||
method: 'POST',
|
||||
data: { code, phone_code: phoneCode, appid },
|
||||
silent: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 转正合并:正式登录令牌调用,把该手机号下的游客数据并入账号
|
||||
* @returns {Promise<object>} 各模块合并条数,如 { notebook: 3, schedule: 1, passwordStore: 2 }
|
||||
*/
|
||||
export function guestMerge() {
|
||||
return request({
|
||||
url: '/api/guest/merge',
|
||||
method: 'POST',
|
||||
data: {},
|
||||
silent: true
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user