做统一认证登录
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
// 检查认证状态
|
||||
|
||||
Reference in New Issue
Block a user