✨ 新增管理员代登录功能
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user