From 8593bcdb986309e3ac267ef254772c3104ca8fd7 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Fri, 15 May 2020 14:45:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?404=E4=B8=8D=E5=86=8D=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=20=E6=96=B9=E4=BE=BF=E9=80=80=E5=87=BA?= =?UTF-8?q?=E5=92=8C=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/router/index.js | 6 ------ web/src/store/module/router.js | 11 ++++++++++- web/src/view/error/index.vue | 3 ++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/web/src/router/index.js b/web/src/router/index.js index 95b80d3f..3e41cdcb 100644 --- a/web/src/router/index.js +++ b/web/src/router/index.js @@ -18,12 +18,6 @@ const baseRouters = [{ name: 'register', component: () => import ('@/view/login/register.vue') - }, - { - path: "/404", - name: "404", - component: () => - import ('@/view/error/index.vue') } ] diff --git a/web/src/store/module/router.js b/web/src/store/module/router.js index 548a42e1..e6dac8e7 100644 --- a/web/src/store/module/router.js +++ b/web/src/store/module/router.js @@ -37,11 +37,20 @@ export const router = { }] const asyncRouterRes = await asyncMenu() const asyncRouter = asyncRouterRes.data.menus + asyncRouter.push({ + path: "404", + name: "404", + hidden: true, + meta: { + title: "迷路了*。*", + }, + component: 'view/error/index.vue' + }) formatRouter(asyncRouter) baseRouter[0].children = asyncRouter baseRouter.push({ path: '*', - redirect: '/404' + redirect: '/layout/404' }) asyncRouterHandle(baseRouter) diff --git a/web/src/view/error/index.vue b/web/src/view/error/index.vue index 23d9fa95..ac91b44b 100644 --- a/web/src/view/error/index.vue +++ b/web/src/view/error/index.vue @@ -4,6 +4,7 @@
页面被神秘力量吸走了,请联系我们修复
+常见问题为菜单未分配仪表盘,可自行分配仪表盘或修改默认路由
↓