From 5735eabe04ce5e1a09f452e3bfcc9647a0ebb6e4 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Wed, 13 May 2026 13:18:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在创作模式中,支持从工作空间获取文件 URL,提升文件处理的灵活性。 - 处理 API 返回的文件 URL,确保正确构建文件链接,优化用户体验。 --- src/views/digitalHuman/creation/index.vue | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/views/digitalHuman/creation/index.vue b/src/views/digitalHuman/creation/index.vue index 9ce0bab..3925760 100644 --- a/src/views/digitalHuman/creation/index.vue +++ b/src/views/digitalHuman/creation/index.vue @@ -1238,6 +1238,11 @@ const sendMessage = async () => { try { // 1. 先上传文件到 OSS,获取文件 URL const fileUrls: string[] = []; + + if (isFromWorkspace.value && currentWorkflowForCreation.value?.fileUrls) { + fileUrls.push(...currentWorkflowForCreation.value.fileUrls); + } + if (selectedFiles.value.length > 0) { for (const file of selectedFiles.value) { const uploadRes = await uploadFile(file); @@ -1368,6 +1373,24 @@ const handleTreeNodeClick = async (data: TreeNode) => { // 标记为从工作空间进入 isFromWorkspace.value = true; + // 处理 fileUrl + const fileUrls: string[] = []; + if (res.data.outputParams && Array.isArray(res.data.outputParams)) { + const prefix = res.data.imgAddressPrefix || ''; + res.data.outputParams.forEach((param: any) => { + Object.values(param).forEach((value: any) => { + if (typeof value === 'string' && value) { + if (value.startsWith('http://') || value.startsWith('https://')) { + fileUrls.push(value); + } else { + fileUrls.push(prefix ? `${prefix}${value}` : value); + } + } + }); + }); + } + res.data.fileUrls = fileUrls; + // 切换到创作模式 isCreationMode.value = true; currentWorkflowForCreation.value = res.data;