diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue index 73faae080..497fbc98b 100644 --- a/ui/src/components/ai-chat/component/chat-input-operate/index.vue +++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue @@ -392,28 +392,36 @@ const uploadFile = async (file: any, fileList: any) => { .then((response) => { fileList.splice(0, fileList.length) uploadImageList.value.forEach((file: any) => { - const f = response.data.filter((f: any) => f.name === file.name) + const f = response.data.filter( + (f: any) => f.name.replaceAll(' ', '') === file.name.replaceAll(' ', '') + ) if (f.length > 0) { file.url = f[0].url file.file_id = f[0].file_id } }) uploadDocumentList.value.forEach((file: any) => { - const f = response.data.filter((f: any) => f.name === file.name) + const f = response.data.filter( + (f: any) => f.name.replaceAll(' ', '') == file.name.replaceAll(' ', '') + ) if (f.length > 0) { file.url = f[0].url file.file_id = f[0].file_id } }) uploadAudioList.value.forEach((file: any) => { - const f = response.data.filter((f: any) => f.name === file.name) + const f = response.data.filter( + (f: any) => f.name.replaceAll(' ', '') === file.name.replaceAll(' ', '') + ) if (f.length > 0) { file.url = f[0].url file.file_id = f[0].file_id } }) uploadVideoList.value.forEach((file: any) => { - const f = response.data.filter((f: any) => f.name === file.name) + const f = response.data.filter( + (f: any) => f.name.replaceAll(' ', '') === file.name.replaceAll(' ', '') + ) if (f.length > 0) { file.url = f[0].url file.file_id = f[0].file_id