fix(menu): MenuListCompatView 字典迭代中修改报错——子孙收集与移除逻辑移出 for 循环(GERP系统/应用中心父级菜单过滤)
This commit is contained in:
1 parent
f54ed506d2
commit
7cb6caea54
2 files changed
+15
-14
No files matched your search
@@ -5,7 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>GERP 管理系统</title>
|
||||
<script type="module" crossorigin src="/assets/index-CSMav8AL.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-84d1wZOe.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/element-plus-DtMR4CIi.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/utils-C0vl14oO.js">
|
||||
@@ -14,7 +14,7 @@
|
||||
<link rel="modulepreload" crossorigin href="/assets/formkit-DL7Nej8X.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/vue-vendor-DmO0PmrK.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/serverScope-C6yhSV7-.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/style-BTrWARrb.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/style-VRk9FrhH.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -145,18 +145,19 @@ class MenuListCompatView(ELTAuthenticatedAPIView):
|
||||
except Exception:
|
||||
logger.exception('MenuListCompatView 权限校验异常 uuid=%s', uuid_str)
|
||||
no_perm_uuids.add(uuid_str)
|
||||
# 收集所有无权限节点的子孙节点
|
||||
def _CollectDescendants(parent_uuid, acc):
|
||||
for uid, item in menu_map.items():
|
||||
if item['ParentUUID'] == parent_uuid and uid not in acc:
|
||||
acc.add(uid)
|
||||
_CollectDescendants(uid, acc)
|
||||
expanded = set()
|
||||
for uuid_str in no_perm_uuids:
|
||||
_CollectDescendants(uuid_str, expanded)
|
||||
no_perm_uuids |= expanded
|
||||
for uuid_str in no_perm_uuids:
|
||||
menu_map.pop(uuid_str, None)
|
||||
|
||||
# 收集所有无权限节点的子孙节点
|
||||
def _CollectDescendants(parent_uuid, acc):
|
||||
for uid, item in menu_map.items():
|
||||
if item['ParentUUID'] == parent_uuid and uid not in acc:
|
||||
acc.add(uid)
|
||||
_CollectDescendants(uid, acc)
|
||||
expanded = set()
|
||||
for uuid_str in no_perm_uuids:
|
||||
_CollectDescendants(uuid_str, expanded)
|
||||
no_perm_uuids |= expanded
|
||||
for uuid_str in no_perm_uuids:
|
||||
menu_map.pop(uuid_str, None)
|
||||
|
||||
# 应用/功能菜单过滤(仅普通用户):企业功能按租户安装状态、个人应用按个人启用状态
|
||||
# 管理员(admin:super/tenant)跳过过滤——管理视角需全览,便于在应用中心管理
|
||||
|
||||
Reference in new issue
Block a user