✨ 新增管理员代登录功能

This commit is contained in:
caojia
2026-11-04 15:20:05 +08:00
parent 93da04fe5e
commit 5cccbf510f
17 changed files with 540 additions and 18 deletions
+2 -1
View File
@@ -2,7 +2,7 @@ import router, { notFoundRoute } from './router'
import { ElMessage } from 'element-plus'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth'
import { getToken, isImpersonationRecoveryInProgress } from '@/utils/auth'
import { isHttp, isPathMatch } from '@/utils/validate'
import { isRelogin } from '@/utils/request'
import useUserStore from '@/store/modules/user'
@@ -59,6 +59,7 @@ router.beforeEach(async (to, from) => {
// 重新导航到目标路由,确保动态路由已注册
return { ...to, replace: true }
} catch (err) {
if (isImpersonationRecoveryInProgress()) return false
await useUserStore().logOut()
useDictStore().cleanDict()
ElMessage.error(err)