From 6d6dec2752fdbfd2e9b7bd7df79af011bce66aba Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:40:10 +0800 Subject: [PATCH] fix: Prevent nested resource issues in type nodes tree API (#15915) Co-authored-by: wangruidong <940853815@qq.com> --- apps/perms/api/user_permission/tree/node_with_asset.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/perms/api/user_permission/tree/node_with_asset.py b/apps/perms/api/user_permission/tree/node_with_asset.py index 6ea22fc69..32d7f998c 100644 --- a/apps/perms/api/user_permission/tree/node_with_asset.py +++ b/apps/perms/api/user_permission/tree/node_with_asset.py @@ -185,6 +185,11 @@ class UserPermedNodeChildrenWithAssetsAsCategoryTreeApi(BaseUserNodeWithAssetAsT return [], [] if not self.tp or not all(self.tp): nodes = UserPermAssetUtil.get_type_nodes_tree_or_cached(self.user) + if self.request.query_params.get('count_resource'): + # 解决在 lina 使用该 api 类型树套娃问题 + for node in nodes: + if node.get('meta'): + node['isParent'] = False return nodes, [] category, tp = self.tp