fix: Prevent nested resource issues in type nodes tree API (#15915)

Co-authored-by: wangruidong <940853815@qq.com>
pull/15916/head
fit2bot 2025-08-25 10:40:10 +08:00 committed by GitHub
parent c6c067c44b
commit 6d6dec2752
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -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