feat: 双token
This commit is contained in:
@@ -15,10 +15,10 @@ const router = createRouter({
|
||||
// 创建路由守卫
|
||||
createRouterGuard(router)
|
||||
|
||||
/** 订阅 401 未授权事件:清除 token 并跳转登录页 */
|
||||
/** 订阅 401 未授权事件:清除认证状态并跳转登录页 */
|
||||
eventBus.on(AppEvents.UNAUTHORIZED, () => {
|
||||
const accountStore = useAccountStore()
|
||||
accountStore.token = ''
|
||||
accountStore.logout()
|
||||
router.push('/auth/login')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user