From e76b49afd2aa6e51c6ac9bfb49084e421cb4db98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E5=BD=A6=E6=A3=8B?= Date: Thu, 14 Mar 2024 17:49:15 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ui):=20=E6=97=A0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- new-ui/projects/admin/src/router/index.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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();