diff --git a/src/router/index.js b/src/router/index.js index a3c1e3f3..b367df8c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -94,6 +94,16 @@ export const moduleRoutes = { isTab: true, }, }, + { + path: "404", + props: true, + component: () => import("@/views/modules/404"), + name: "main-404", + meta: { + title: "页面未找到或无权访问", + isTab: false, + }, + }, ], }; @@ -129,6 +139,16 @@ export const moduleShujuRoutes = { isTab: false, }, }, + { + path: "404", + props: true, + component: () => import("@/views/modules/visual/404"), + name: "main-shuju-404", + meta: { + title: "页面未找到或无权访问", + isTab: false, + }, + }, ], }; @@ -519,10 +539,10 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) { children: routes, }, { - path: "*", - // redirect: { - // name: "404", - // }, + path: "/main/*", + redirect: { + path: "/main/404", + }, }, ]); window.SITE_CONFIG["dynamicMenuRoutes"] = routes; @@ -593,10 +613,10 @@ function fnAddDynamicMenuRoutes2(menuList = [], routes = []) { children: routes, }, { - path: "*", - // redirect: { - // name: "404", - // }, + path: "/main-shuju/*", + redirect: { + path: "/main-shuju/404", + }, }, ]); window.SITE_CONFIG["dynamicMenuRoutesShuju"] = routes; diff --git a/src/views/modules/404.vue b/src/views/modules/404.vue new file mode 100644 index 00000000..33682a33 --- /dev/null +++ b/src/views/modules/404.vue @@ -0,0 +1,16 @@ + + + + + diff --git a/src/views/modules/visual/404.vue b/src/views/modules/visual/404.vue new file mode 100644 index 00000000..047aec70 --- /dev/null +++ b/src/views/modules/visual/404.vue @@ -0,0 +1,16 @@ + + + + + diff --git a/src/views/pages/404.vue b/src/views/pages/404.vue index 5d49d643..e7796ec6 100644 --- a/src/views/pages/404.vue +++ b/src/views/pages/404.vue @@ -2,11 +2,11 @@
-

404

+

页面未找到或无权访问

{{ $t('notFound.back') }} - {{ $t('notFound.home') }} + {{ $t('notFound.home') }}