feat: 双token

This commit is contained in:
2026-06-16 16:16:47 +08:00
parent d9b8567b6d
commit 172c83ea73
8 changed files with 455 additions and 79 deletions

View File

@@ -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')
})