From 92302c061dc1b0b2ba2e69d8bedc51ffc2aa3141 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Sat, 8 Feb 2025 18:50:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3vue=20route=20warn=20n?= =?UTF-8?q?ot=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 6 ------ src/router/systemRouter.js | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) 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'),