|
@@ -288,6 +288,21 @@ export const constantRoutes = [
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
+
|
|
|
+ {
|
|
|
+ path: '/whitelist',
|
|
|
+ component: AppMain,
|
|
|
+ redirect: '/whitelist-search',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ path: '/whitelist-search',
|
|
|
+ name: 'WhitelistSearch',
|
|
|
+ component: () => import('@/views/searchSystem/index'),
|
|
|
+ meta: { keepAlive:true },
|
|
|
+ hidden: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
];
|
|
|
|
|
|
const createRouter = () =>
|
|
@@ -299,7 +314,7 @@ const createRouter = () =>
|
|
|
|
|
|
const router = createRouter();
|
|
|
|
|
|
-const whiteList = ['/login','/404']; // 添加路由白名单
|
|
|
+const whiteList = ['/login','/404', '/whitelist-search']; // 添加路由白名单
|
|
|
//路由判断
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
const hasToken = getToken();
|
|
@@ -336,7 +351,6 @@ router.beforeEach(async (to, from, next) => {
|
|
|
// 在白名单内直接放行
|
|
|
next();
|
|
|
} else {
|
|
|
- console.log('1')
|
|
|
// 其他没有访问权限的页面将被重定向到登录页面。
|
|
|
next(`/login?redirect=${to.path}`);
|
|
|
}
|