From e4b5c2781e64fd96057062d83bbc22af1b46cb43 Mon Sep 17 00:00:00 2001 From: Defined <39450947+imaginarykhy@users.noreply.github.com> Date: Thu, 29 Sep 2022 20:34:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=9B=E5=85=A5=20404=20=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=97=B6=E4=BF=9D=E7=95=99=E5=BD=93=E5=89=8D=20URL=20?= =?UTF-8?q?(#14)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index b0df9fb..5788be9 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -17,6 +17,23 @@ export const constantRoutes: RouteRecordRaw[] = [ } ] }, + { + path: "/403", + component: () => import("@/views/error-page/403.vue"), + name: "403", + meta: { + hidden: true + } + }, + { + path: "/404", + component: () => import("@/views/error-page/404.vue"), + name: "404", + meta: { + hidden: true + }, + alias: "/:pathMatch(.*)*" + }, { path: "/login", component: () => import("@/views/login/index.vue"), @@ -173,32 +190,11 @@ export const asyncRoutes: RouteRecordRaw[] = [ }, { path: "/:pathMatch(.*)*", // 必须将 'ErrorPage' 路由放在最后, Must put the 'ErrorPage' route at the end - component: Layout, redirect: "/404", name: "ErrorPage", meta: { - title: "错误页面", - icon: "404", hidden: true - }, - children: [ - { - path: "403", - component: () => import("@/views/error-page/403.vue"), - name: "403", - meta: { - title: "403" - } - }, - { - path: "404", - component: () => import("@/views/error-page/404.vue"), - name: "404", - meta: { - title: "404" - } - } - ] + } } ]