feat: 完善双端演示注册与红娘服务闭环
This commit is contained in:
@@ -33,6 +33,12 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
return data
|
||||
}
|
||||
|
||||
async function registerDemo(code: string, displayName: string, phone?: string) {
|
||||
const data = await authService.demoRegister({ code, displayName, phone })
|
||||
applyTokens(data)
|
||||
return data
|
||||
}
|
||||
|
||||
function clearSession() {
|
||||
accessToken.value = null
|
||||
userId.value = null
|
||||
@@ -51,5 +57,5 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
clearSession()
|
||||
}
|
||||
|
||||
return { accessToken, userId, isNewUser, isLoggedIn, loginByDemoCode, applyTokens, clearSession, logout }
|
||||
return { accessToken, userId, isNewUser, isLoggedIn, loginByDemoCode, registerDemo, applyTokens, clearSession, logout }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user