fix: workspace_tree id=__root__ returns children
This commit is contained in:
parent
340dcf0fd0
commit
61fb3f6485
@ -29,13 +29,12 @@ async with DBPools().sqlorContext(dbname) as sor:
|
||||
ws_dir = ws if ws.startswith('/') else workspace_base + '/' + org_id + '/' + pname
|
||||
|
||||
if not ws_dir or not os.path.isdir(ws_dir):
|
||||
if not node_id or node_id == '__root__':
|
||||
if not node_id:
|
||||
return [{"id": "__root__", "parentid": "", "label": "📁 工作空间(不可用)", "path": "", "is_leaf": False}]
|
||||
return []
|
||||
|
||||
# 确定要扫描的目录
|
||||
if not node_id or node_id == '__root__':
|
||||
# 初始加载:返回根节点
|
||||
# 初始加载:无 id 参数,只返回根节点
|
||||
if not node_id:
|
||||
return [{
|
||||
"id": "__root__",
|
||||
"parentid": "",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user