fix: 临时解决系统菜单路由问题
parent
9697f73a51
commit
7eaa5b8393
|
@ -0,0 +1,30 @@
|
|||
import type { AppRouteModule } from '@/router/types'
|
||||
|
||||
import { LAYOUT } from '@/router/constant'
|
||||
|
||||
const menu: AppRouteModule = {
|
||||
path: '/sysmenu',
|
||||
name: 'SysMenu',
|
||||
component: LAYOUT,
|
||||
redirect: '/sysmenu/index',
|
||||
meta: {
|
||||
hideChildrenInMenu: true,
|
||||
icon: 'ant-design:bank-twotone',
|
||||
title: '系统菜单',
|
||||
orderNo: 9999
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'SystemMenu',
|
||||
component: () => import('@/views/system/menu/index.vue'),
|
||||
meta: {
|
||||
title: '系统菜单',
|
||||
icon: 'ant-design:bank-twotone',
|
||||
hideMenu: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export default menu
|
|
@ -8,6 +8,7 @@ import { useUserStore } from './user'
|
|||
import { useAppStoreWithOut } from './app'
|
||||
import { asyncRoutes } from '@/router/routes'
|
||||
import about from '@/router/routes/modules/about'
|
||||
import menu from '@/router/routes/modules/menu'
|
||||
import dashboard from '@/router/routes/modules/dashboard'
|
||||
import { PAGE_NOT_FOUND_ROUTE } from '@/router/routes/basic'
|
||||
import { transformRouteToMenu } from '@/router/helper/menuHelper'
|
||||
|
@ -227,7 +228,7 @@ export const usePermissionStore = defineStore('app-permission', {
|
|||
|
||||
// Background routing to menu structure
|
||||
// 后台路由到菜单结构
|
||||
const backMenuList = transformRouteToMenu([dashboard, ...routeList, about])
|
||||
const backMenuList = transformRouteToMenu([dashboard, ...routeList, menu, about])
|
||||
this.setBackMenuList(backMenuList)
|
||||
|
||||
// remove meta.ignoreRoute item
|
||||
|
@ -235,7 +236,7 @@ export const usePermissionStore = defineStore('app-permission', {
|
|||
routeList = filter(routeList, routeRemoveIgnoreFilter)
|
||||
routeList = routeList.filter(routeRemoveIgnoreFilter)
|
||||
routeList = flatMultiLevelRoutes(routeList)
|
||||
routes = [PAGE_NOT_FOUND_ROUTE, dashboard, ...routeList, about]
|
||||
routes = [PAGE_NOT_FOUND_ROUTE, dashboard, ...routeList, menu, about]
|
||||
break
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue