From f422e9b4202e93c2e60f07a8a0bc518a74bb856a Mon Sep 17 00:00:00 2001 From: ssw Date: Fri, 31 Jul 2026 10:50:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(dacli/workflow=20create):=20BS-=E6=96=B0145?= =?UTF-8?q?=20catch=20=E5=86=85=E8=AE=BF=E9=97=AE=20templateId=20(let=20?= =?UTF-8?q?=E4=B8=8A=E6=8F=90=E5=88=B0=20try=20=E5=A4=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before: `let templateId = ''` 在 try 块内部声明, catch 闭包内不可见 → TS2304 Cannot find name 'templateId' (4 处) → 实际语义错位 (catch 块没法 cleanup 残留 template) After: `let templateId` 在 async 回调体作用域声明 (try 之前) → catch 通过闭包可见 → 测试通过后强制走主分支质量门 --- src/commands/workflow/create.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/workflow/create.ts b/src/commands/workflow/create.ts index cee137d..89e29ed 100644 --- a/src/commands/workflow/create.ts +++ b/src/commands/workflow/create.ts @@ -123,9 +123,9 @@ export function buildWorkflowCreateCommand(): Command { json: opts.json, fixes: [...cmdFix.silent, ...cmdFix.assertive, ...cmdFix.suggestions], }, async (ctx) => { - try { // BS-新145 (2026-07-30 jxcj M1): 提前声明 templateId, 让 catch 块能 cleanup 残留 let templateId = '' + try { // (Round 8 P0): workflow 没绑 startFormId → 浏览器报 "workFlowForm/undefined.vue" // step 1 拦截: 提示用户传 --startFormId (web NodeFormParser.vue:59-64)