From 5e84ddbb07ac4374b75d60e61bee62a7468e296c Mon Sep 17 00:00:00 2001 From: ymq Date: Fri, 14 Aug 2026 18:09:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20workspace=5Fbrowse=20=E8=A1=A5=20import?= =?UTF-8?q?=20json=20+=20=E5=8E=BB=20pid=20=E6=AE=8B=E7=95=99=EF=BC=9Bwork?= =?UTF-8?q?space=5Fpopup=20=E5=A4=8D=E7=94=A8=20get=5Fworkspace=5Fdir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/workspace_browse.dspy | 2 +- wwwroot/api/workspace_popup.dspy | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/wwwroot/api/workspace_browse.dspy b/wwwroot/api/workspace_browse.dspy index a2049a5..7d16009 100644 --- a/wwwroot/api/workspace_browse.dspy +++ b/wwwroot/api/workspace_browse.dspy @@ -6,6 +6,7 @@ if not uid: dbname = get_module_dbname('pipeline-sdlc') import os +import json async with DBPools().sqlorContext(dbname) as sor: ws_dir, _ = await get_workspace_dir(sor, uid) @@ -41,6 +42,5 @@ tree = build_tree(ws_dir) return json.dumps({ "workspace": ws_dir, - "project_id": pid, "tree": tree, }, ensure_ascii=False, default=str) diff --git a/wwwroot/api/workspace_popup.dspy b/wwwroot/api/workspace_popup.dspy index d8119cc..fcd4252 100644 --- a/wwwroot/api/workspace_popup.dspy +++ b/wwwroot/api/workspace_popup.dspy @@ -7,20 +7,14 @@ if not uid: uid = 'user-01' dbname = get_module_dbname('pipeline-sdlc') +import os async with DBPools().sqlorContext(dbname) as sor: - recs = await sor.sqlExe( - "SELECT current_project_id FROM pipeline_agent_settings WHERE user_id=${u}$", - {"u": uid}) - pid = getattr(recs[0], 'current_project_id', '') if recs else '' + ws_dir, _ = await get_workspace_dir(sor, uid) - pname = '' - if pid: - proj = await sor.sqlExe("SELECT name FROM sd_projects WHERE id=${p}$", {"p": pid}) - if proj: - pname = getattr(proj[0], 'name', '') + pname = os.path.basename(ws_dir) if ws_dir else '' - if not pid: + if not ws_dir: resp = { "widgettype": "PopupWindow", "options": {"title": "提示", "cwidth": 30, "cheight": 8, "auto_open": True},