From b35b57fcd0b798eb39de913a4adebe1e11bdf125 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 4 Dec 2024 14:36:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=B8=8A=E4=BC=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/chat-input-operate/index.vue | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) 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 452a5d0d7..004748175 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 @@ -75,9 +75,9 @@
- { fileList.splice(0, fileList.length) return } - const formData = new FormData() - for (const file of fileList) { - formData.append('file', file.raw, file.name) - // - const extension = file.name.split('.').pop().toLowerCase() // 获取文件后缀名并转为小写 - if (imageExtensions.includes(extension)) { - uploadImageList.value.push(file) - } else if (documentExtensions.includes(extension)) { - uploadDocumentList.value.push(file) - } else if (videoExtensions.includes(extension)) { - // videos.push(file) - } else if (audioExtensions.includes(extension)) { - // audios.push(file) - } + const formData = new FormData() + formData.append('file', file.raw, file.name) + // + const extension = file.name.split('.').pop().toLowerCase() // 获取文件后缀名并转为小写 + + if (imageExtensions.includes(extension)) { + uploadImageList.value.push(file) + } else if (documentExtensions.includes(extension)) { + uploadDocumentList.value.push(file) + } else if (videoExtensions.includes(extension)) { + // videos.push(file) + } else if (audioExtensions.includes(extension)) { + // audios.push(file) } + if (!chatId_context.value) { const res = await props.openChatId() chatId_context.value = res