|
@@ -2,10 +2,16 @@ import type { RouteRecordRaw } from 'vue-router';
|
|
|
import type { App } from 'vue';
|
|
|
|
|
|
import { createRouter, createWebHashHistory } from 'vue-router';
|
|
|
-import { basicRoutes, LoginRoute } from './routes';
|
|
|
-import { REDIRECT_NAME } from './constant';
|
|
|
+import { basicRoutes } from './routes';
|
|
|
|
|
|
-const WHITE_NAME_LIST = [LoginRoute.name, REDIRECT_NAME];
|
|
|
+// 白名单应该包含基本静态路由
|
|
|
+const WHITE_NAME_LIST: string[] = [];
|
|
|
+const getRouteNames = (array: any[]) =>
|
|
|
+ array.forEach((item) => {
|
|
|
+ WHITE_NAME_LIST.push(item.name);
|
|
|
+ getRouteNames(item.children || []);
|
|
|
+ });
|
|
|
+getRouteNames(basicRoutes);
|
|
|
|
|
|
// app router
|
|
|
export const router = createRouter({
|