做统一认证登录

This commit is contained in:
2026-09-19 21:44:04 +08:00
parent 1a4471e34d
commit fa281363fb
78 changed files with 8127 additions and 1442 deletions
+5
View File
@@ -1,6 +1,7 @@
import { defineStore } from 'pinia'
import { ref, reactive } from 'vue'
import { getCurrentUser } from '@/api/login'
import { isSSOEnabled, logoutSSO } from '@/utils/authClient'
// 用户信息类型
const defaultUser = {
@@ -93,6 +94,10 @@ export const useAuthStore = defineStore('auth', () => {
Object.assign(user, defaultUser)
localStorage.removeItem('token')
localStorage.removeItem('userInfo')
// 统一认证模式:吊销令牌并跳认证中心完成单点登出(所有调用点自动生效)
if (isSSOEnabled()) {
logoutSSO()
}
}
// 检查认证状态