mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-05-01 14:49:00 +08:00
fix: 当用户访问一个当前用户没有的权限时导航去404
This commit is contained in:
parent
9a22ac1659
commit
be2dedf4e4
@ -44,6 +44,7 @@ export function createPermissionGuard(router) {
|
||||
}
|
||||
|
||||
router.addRoute({
|
||||
name: 'catchAll',
|
||||
path: '/:catchAll(.*)',
|
||||
redirect: '/404',
|
||||
})
|
||||
|
@ -16,6 +16,8 @@ export const useRouterStore = defineStore('router', () => {
|
||||
accessRoutes.forEach((item) => {
|
||||
router.hasRoute(item.name) && router.removeRoute(item.name)
|
||||
})
|
||||
|
||||
router.removeRoute('catchAll')
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user