Skip to content

Commit 4bcd352

Browse files
author
piexlmax
committed
清理刷新路由时出现的warning
1 parent 7407f7b commit 4bcd352

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

web/src/pinia/modules/router.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,6 @@ export const useRouterStore = defineStore('router', () => {
7777
const asyncRouterRes = await asyncMenu()
7878
const asyncRouter = asyncRouterRes.data.menus
7979
asyncRouter && asyncRouter.push({
80-
path: '404',
81-
name: '404',
82-
hidden: true,
83-
meta: {
84-
title: '迷路了*。*',
85-
closeTab: true,
86-
},
87-
component: 'view/error/index.vue'
88-
}, {
8980
path: 'reload',
9081
name: 'Reload',
9182
hidden: true,
@@ -100,11 +91,6 @@ export const useRouterStore = defineStore('router', () => {
10091
if (notLayoutRouterArr.length !== 0) {
10192
baseRouter.push(...notLayoutRouterArr)
10293
}
103-
baseRouter.push({
104-
path: '/:catchAll(.*)',
105-
redirect: '/layout/404'
106-
107-
})
10894
asyncRouterHandle(baseRouter)
10995
KeepAliveFilter(asyncRouter)
11096
asyncRouters.value = baseRouter

web/src/router/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ const routes = [{
1313
path: '/login',
1414
name: 'Login',
1515
component: () => import('@/view/login/index.vue')
16+
},
17+
{
18+
path: '/:catchAll(.*)',
19+
meta: {
20+
closeTab: true,
21+
},
22+
component: () => import('@/view/error/index.vue')
1623
}
1724
]
1825

0 commit comments

Comments
 (0)