From dbd41cc045bb6963255f7d6619131965970ba7f3 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Mon, 24 Aug 2026 09:26:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E4=BA=A7=E5=87=BA=EF=BC=9AresultFileUrl=20=E9=80=97=E5=8F=B7?= =?UTF-8?q?=E6=8B=BC=E6=8E=A5=E5=A4=9A=20URL=20=E7=BB=9F=E4=B8=80=E6=8B=86?= =?UTF-8?q?=E5=88=86=EF=BC=88=E5=85=BC=E5=AE=B9=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?/=E6=95=B0=E7=BB=84=E5=85=A5=E5=8F=82=EF=BC=89=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E6=98=BE=E4=B8=8E=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E4=BA=A7=E5=87=BA=E6=B8=B2=E6=9F=93=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- src/views/home/utils/flowDsl.ts | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/views/home/utils/flowDsl.ts b/src/views/home/utils/flowDsl.ts index bf7d565..e9aef43 100644 --- a/src/views/home/utils/flowDsl.ts +++ b/src/views/home/utils/flowDsl.ts @@ -199,21 +199,28 @@ export function extractWorkflowOutputs(data: any, backendId?: string): WorkflowO // 不依赖执行详情的异步查询,type 同样按扩展名推断,去重后归一为 { url, name, type, backendId }。 // 用于完成事件即时渲染产出卡片,删除时 backendId 为空则跳过删除接口(安全降级)。 export function buildOutputsFromUrls(urls: any, backendId?: string): WorkflowOutput[] { - if (!Array.isArray(urls)) return []; + // 兼容两种入参:字符串(逗号拼接多 URL)或数组(元素本身可能是逗号拼接串); + // 合法 URL 不含裸逗号,统一按逗号拆分后逐条归一化,避免把整串误当单个产出 + const arr: string[] = typeof urls === 'string' ? [urls] : Array.isArray(urls) ? urls : []; const seen = new Set(); const outputs: WorkflowOutput[] = []; - for (const u of urls) { + for (const u of arr) { if (typeof u !== 'string') continue; - const url = u.trim(); - if (!url || seen.has(url)) continue; - seen.add(url); - const name = String(url).split('?')[0].split('/').pop() || '产出文件'; - outputs.push({ - url, - name, - type: guessFileType(url), - backendId: backendId || '', - }); + const parts = u + .split(',') + .map((s) => s.trim()) + .filter(Boolean); + for (const url of parts) { + if (seen.has(url)) continue; + seen.add(url); + const name = String(url).split('?')[0].split('/').pop() || '产出文件'; + outputs.push({ + url, + name, + type: guessFileType(url), + backendId: backendId || '', + }); + } } return outputs; }