From ecdf558672a35aae9aa3af84219814e2329eddab Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 2 Dec 2025 14:40:45 +0800 Subject: [PATCH] fix: update mp3 MIME type and improve file upload error handling --- .../components/ai-chat/component/chat-input-operate/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 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 61ed9c387..b9c5d6a9f 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 @@ -1120,7 +1120,7 @@ const mime_types = { "mid": "audio/midi", "midi": "audio/midi", "kar": "audio/midi", - "mp3": "audio/mp3", + "mp3": "audio/mpeg", "ogg": "audio/ogg", "m4a": "audio/x-m4a", "ra": "audio/x-realaudio", @@ -1240,7 +1240,7 @@ async function saveUrl() { try { const appId = props.appId || props.applicationDetails?.id; const res = await imageApi.getFile(appId, {url}); - if (!res.data) { + if (res.data['status_code'] !== 200) { MsgWarning(url + ' ' + t('chat.uploadFile.invalidUrl')); return; }