diff --git a/wwwroot/api/workspace_tree.dspy b/wwwroot/api/workspace_tree.dspy index 9018d1c..732fca0 100644 --- a/wwwroot/api/workspace_tree.dspy +++ b/wwwroot/api/workspace_tree.dspy @@ -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": "",