fix(router): validate server session before loading routes

This commit is contained in:
Kroytz committed 2026-07-19 00:32:14 +08:00
1 parent 17b2ba49a8
commit 6ffdbcb3d7
7 files changed
+40 -54

No files matched your search

+2 -3
View File
@@ -9,7 +9,7 @@ import axios, {
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
import qs from 'qs'
import { config } from '@/config/axios/config'
import { getTenantId, removeAuthenticated } from '@/utils/auth'
import { getTenantId } from '@/utils/auth'
import errorCode from './errorCode'
import { resetRouter } from '@/router'
@@ -201,9 +201,8 @@ const handleAuthorized = () => {
type: 'warning'
}).then(() => {
resetRouter() // 重置静态路由表
removeAuthenticated()
isRelogin.show = false
// 干掉token后再走一次路由让它过router.beforeEach的校验
// 重新加载后由路由守卫向服务端确认会话
window.location.href = window.location.href
})
}