From 07b99c6e7584c09f756adc2f694fc4445ad5a263 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 20 Jan 2026 14:20:50 +0000 Subject: [PATCH] =?UTF-8?q?fix(ai-assistant):=20=E4=BF=AE=E5=A4=8D=20SSE?= =?UTF-8?q?=20=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5=E6=97=B6=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=9C=AA=E6=AD=A3=E7=A1=AE=E6=9B=B4=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当 SSE 连接一开始就失败时,响应状态保持 'waiting' 而非 'streaming', 导致 onFailed 回调不会更新状态,UI 一直显示 loading。 现在同时处理 'streaming' 和 'waiting' 状态,并标记为错误状态显示失败提示。 Co-Authored-By: Claude Opus 4.5 --- resources/assets/js/components/AIAssistant/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/AIAssistant/index.vue b/resources/assets/js/components/AIAssistant/index.vue index 77ec8e741..08433fc96 100644 --- a/resources/assets/js/components/AIAssistant/index.vue +++ b/resources/assets/js/components/AIAssistant/index.vue @@ -945,8 +945,8 @@ export default { } }, () => { // SSE 连接失败(重试次数用完)时的回调 - if (responseEntry && responseEntry.status === 'streaming') { - responseEntry.status = 'completed'; + if (responseEntry && ['streaming', 'waiting'].includes(responseEntry.status)) { + this.markResponseError(responseEntry, this.$L('连接失败,请重试')); } this.releaseSSEClient(sse); this.saveCurrentSession();