diff --git a/src/router/routes/modules/menu.ts b/src/router/routes/modules/menu.ts new file mode 100644 index 00000000..bc4c1d0a --- /dev/null +++ b/src/router/routes/modules/menu.ts @@ -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 diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 2a0a1727..5e99cd9a 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -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 }