diff --git a/new-ui/projects/admin/src/router/index.ts b/new-ui/projects/admin/src/router/index.ts index 990732df..f3c0a98c 100644 --- a/new-ui/projects/admin/src/router/index.ts +++ b/new-ui/projects/admin/src/router/index.ts @@ -10,11 +10,6 @@ const whiteListRoutes = [ name: "Login", component: () => import("@/views/LoginView.vue"), }, - { - path: "/403", - name: "403", - component: () => import("@/views/NoPermission.vue"), - }, { path: "/:pathMatch(.*)*", name: "404", @@ -30,13 +25,20 @@ const router = createRouter({ name: 'home', component: CustomLayout, redirect: () => menu[0].path, - children: menu + children: [ + { + path: "403", + name: "403", + component: () => import("@/views/NoPermission.vue"), + }, + ...menu + ] }, ...whiteListRoutes ] }) -const whiteList = whiteListRoutes.map((i) => i.name); +const whiteList = [...whiteListRoutes.map((i) => i.name), "403"]; router.beforeEach((to, _, next) => { const authStore = useAuthStore();