From 7cb6caea5486d92658ff0b06201673311e08f433 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Thu, 13 Aug 2026 04:33:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(menu):=20MenuListCompatView=20=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E8=BF=AD=E4=BB=A3=E4=B8=AD=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E2=80=94=E2=80=94=E5=AD=90=E5=AD=99=E6=94=B6=E9=9B=86?= =?UTF-8?q?=E4=B8=8E=E7=A7=BB=E9=99=A4=E9=80=BB=E8=BE=91=E7=A7=BB=E5=87=BA?= =?UTF-8?q?=20for=20=E5=BE=AA=E7=8E=AF=EF=BC=88GERP=E7=B3=BB=E7=BB=9F/?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E4=B8=AD=E5=BF=83=E7=88=B6=E7=BA=A7=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E8=BF=87=E6=BB=A4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TempLate/GERP/index.html | 4 ++-- gvsds/apps/gerp/views/menu.py | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/TempLate/GERP/index.html b/TempLate/GERP/index.html index 3f25fec5..76109c7c 100644 --- a/TempLate/GERP/index.html +++ b/TempLate/GERP/index.html @@ -5,7 +5,7 @@ GERP 管理系统 - + @@ -14,7 +14,7 @@ - +
diff --git a/gvsds/apps/gerp/views/menu.py b/gvsds/apps/gerp/views/menu.py index 3b186ea5..537d7c87 100644 --- a/gvsds/apps/gerp/views/menu.py +++ b/gvsds/apps/gerp/views/menu.py @@ -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)跳过过滤——管理视角需全览,便于在应用中心管理