|
@@ -2,8 +2,7 @@ import { AxiosWrapper } from '@/utils/axios-wrapper'
|
|
|
import { checkResult } from '@/utils/checkResult'
|
|
|
import { UserStore } from '@/store/user'
|
|
|
import { cloneDeep, omit } from 'lodash-es'
|
|
|
-import { translateRouteTitle } from '@/utils/i18n'
|
|
|
-import i18n from '@/lang/index'
|
|
|
+import { useAppStore } from '@/store'
|
|
|
// 检查路由是否存在
|
|
|
const hasNecessaryRoute = (to, router) => {
|
|
|
// 将默认注册的路由平铺成一维数组
|
|
@@ -144,8 +143,10 @@ export const registerBeforeRouter = async (router) => {
|
|
|
// 注册路由后置守卫
|
|
|
|
|
|
export const registerAfterRouter = async (router) => {
|
|
|
- router.afterEach((to, form) => {
|
|
|
- if (to.path === '/login') return
|
|
|
+ router.afterEach(async (to, form) => {
|
|
|
+ if (to.path === '/login') {
|
|
|
+ return
|
|
|
+ }
|
|
|
// 请求该页面的权限
|
|
|
})
|
|
|
}
|