fix: 解决vue route warn not found
This commit is contained in:
parent
4dddbce330
commit
92302c061d
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue