fixed: 进入404页面不会触发获取菜单.

This commit is contained in:
lijiahang
2023-08-15 18:34:09 +08:00
parent fa8dc6d8fa
commit 4facfc66cd
12 changed files with 54 additions and 22 deletions

View File

@@ -18,9 +18,15 @@ export const DEFAULT_ROUTE_FULL_PATH = '/dashboard/workplace';
*/
export const WHITE_ROUTER_LIST = [
{ name: LOGIN_ROUTE_NAME, children: [] },
{ name: REDIRECT_ROUTE_NAME, children: [] },
];
/**
* 状态路由
*/
export const STATUS_ROUTER_LIST = [
{ name: NOT_FOUND_ROUTER_NAME, children: [] },
{ name: FORBIDDEN_ROUTER_NAME, children: [] },
{ name: REDIRECT_ROUTE_NAME, children: [] },
];
/**

View File

@@ -53,7 +53,7 @@ export const REDIRECT_ROUTER: RouteRecordRaw = {
* 403 页面
*/
export const FORBIDDEN_ROUTE: RouteRecordRaw = {
path: '/:pathMatch(.*)*',
path: '/403',
name: FORBIDDEN_ROUTER_NAME,
component: () => import('@/views/exception/forbidden/index.vue'),
};
@@ -62,7 +62,8 @@ export const FORBIDDEN_ROUTE: RouteRecordRaw = {
* 404 页面
*/
export const NOT_FOUND_ROUTE: RouteRecordRaw = {
path: '/:pathMatch(.*)*',
// path: '/:pathMatch(.*)*',
path: '/404',
name: NOT_FOUND_ROUTER_NAME,
component: () => import('@/views/exception/not-found/index.vue'),
};

View File

@@ -7,14 +7,14 @@ const USER: AppRouteRecordRaw = {
component: DEFAULT_LAYOUT,
children: [
{
path: '/user/userChild1',
name: 'userChild1',
component: () => import('@/views/user/child1/index.vue'),
name: 'userRole',
path: '/user/role',
component: () => import('@/views/user/role/index.vue'),
},
{
path: '/user/userChild2',
name: 'userChild2',
component: () => import('@/views/user/child2/index.vue'),
name: 'userUser',
path: '/user/user',
component: () => import('@/views/user/user/index.vue'),
},
],
};