diff --git a/src/router/index.js b/src/router/index.js index 91501cd..dd1e369 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -12,11 +12,6 @@ import { beforeEach, afterEach } from './scrollBehavior'; const routes = systemRouter //系统特殊路由 -const routes_404 = { - path: "/:pathMatch(.*)*", - hidden: true, - component: () => import(/* webpackChunkName: "404" */ '@/layout/other/404'), -} let routes_404_r = () => { } const router = createRouter({ @@ -76,7 +71,6 @@ router.beforeEach(async (to, from, next) => { menuRouter.forEach(item => { router.addRoute("layout", item) }); - routes_404_r = router.addRoute(routes_404); if (to.matched.length == 0) { router.push(to.fullPath); } diff --git a/src/router/systemRouter.js b/src/router/systemRouter.js index ae775ad..877edd2 100644 --- a/src/router/systemRouter.js +++ b/src/router/systemRouter.js @@ -16,6 +16,11 @@ const routes = [ title: "登录" } }, + { + path: "/:pathMatch(.*)*", + hidden: true, + component: () => import(/* webpackChunkName: "404" */ '@/layout/other/404'), + }, { path: "/user_register", component: () => import(/* webpackChunkName: "userRegister" */ '@/views/login/userRegister'),