mirror of https://github.com/jumpserver/jumpserver
fix: 修复异步加载luna资产授权树时根节点下资产没有返回的问题
parent
4aed287efc
commit
3443b06a28
|
@ -102,6 +102,12 @@ class UserPermedNodeChildrenWithAssetsAsTreeApi(BaseUserNodeWithAssetAsTreeApi):
|
|||
if not node_key:
|
||||
nodes = query_node_util.get_top_level_nodes()
|
||||
assets = Asset.objects.none()
|
||||
# 获取根节点下的资产
|
||||
for node in nodes:
|
||||
if not node.key.isdigit():
|
||||
continue
|
||||
assets = query_asset_util.get_node_assets(key=node.key)
|
||||
break
|
||||
elif node_key == PermNode.UNGROUPED_NODE_KEY:
|
||||
nodes = PermNode.objects.none()
|
||||
assets = query_asset_util.get_ungroup_assets()
|
||||
|
|
|
@ -150,6 +150,7 @@ class UserPermNodeUtil:
|
|||
|
||||
def get_top_level_nodes(self):
|
||||
nodes = self.get_special_nodes()
|
||||
# 获取组织下的根节点
|
||||
real_nodes = self._get_indirect_perm_node_children(key='')
|
||||
nodes.extend(real_nodes)
|
||||
if len(real_nodes) == 1:
|
||||
|
|
Loading…
Reference in New Issue