sso修复

This commit is contained in:
biss committed 2026-08-23 22:41:02 +08:00
1 parent 76b26a49a8
commit d95ff27ee4
7 files changed
+104 -37

No files matched your search

+8
View File
@@ -7,6 +7,10 @@ import {
isNativeApp,
saveAuthSession,
} from '../auth/session'
import {
clearNativeSsoLoginState,
nativeSsoLoginState,
} from '../services/nativeAppLinks'
export interface CurrentUser {
id: string
@@ -39,10 +43,12 @@ export const useAuthStore = defineStore('auth', () => {
const { data } = await http.post('/auth/sso/exchange', {
code,
isNativeApp: isNativeApp(),
nativeState: nativeSsoLoginState(),
})
token.value = data.token
user.value = data.user
saveAuthSession(data)
clearNativeSsoLoginState()
}
async function bindSso(code: string, userName: string, password: string) {
@@ -51,10 +57,12 @@ export const useAuthStore = defineStore('auth', () => {
userName,
password,
isNativeApp: isNativeApp(),
nativeState: nativeSsoLoginState(),
})
token.value = data.token
user.value = data.user
saveAuthSession(data)
clearNativeSsoLoginState()
}
async function refresh() {