fix: 临时解决系统菜单路由问题

pull/5/MERGE
xingyu 2023-04-24 18:14:51 +08:00
parent 9697f73a51
commit 7eaa5b8393
2 changed files with 33 additions and 2 deletions

View File

@ -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

View File

@ -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
}