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;