3
0
Prechádzať zdrojové kódy

[Fix 0000] 修复了菜单权限管理时无法正确显示菜单项的问题

houzekong 2 mesiacov pred
rodič
commit
4fb91e2743
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      src/api/sys/menu.ts

+ 2 - 1
src/api/sys/menu.ts

@@ -9,6 +9,7 @@ import { getFormattedText } from '/@/components/Configurable/hooks/helper';
 // import { listToTree } from '/@/utils/helper/treeHelper';
 import { MineDepartment, useMineDepartmentStore } from '/@/store/modules/mine';
 import { AppRouteRecordRaw } from '/@/router/types';
+import { cloneDeep } from 'lodash';
 
 enum Api {
   GetMenuList = '/sys/permission/getUserPermissionByToken',
@@ -75,7 +76,7 @@ export const getMenuList: () => Promise<getMenuListResultModel> = () => {
       auth: res.auth || [],
       codeList: res.codeList || [],
       // menu: __STATIC_ROUTES__,
-      menu: processStaticRoutes(__STATIC_ROUTES__, mineStore).map((route) => {
+      menu: processStaticRoutes(cloneDeep(__STATIC_ROUTES__), mineStore).map((route) => {
         if (route.meta?.generation && route.children && route.children.length) {
           const template = route.children[0];
           route.children = generateStaticSealedMonitorRoute(template, mineStore.getDepartTree);