mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-22 21:17:30 +00:00
fix: Prevent nested resource issues in type nodes tree API
This commit is contained in:
parent
8aec1604ce
commit
eec7b54534
@ -176,6 +176,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
|
||||
|
Loading…
Reference in New Issue
Block a user