diff --git a/pages/chat/ChatMainList.vue b/pages/chat/ChatMainList.vue index cc4ad36..87bb41d 100644 --- a/pages/chat/ChatMainList.vue +++ b/pages/chat/ChatMainList.vue @@ -344,6 +344,7 @@ const initWebSocket = () => { // 错误回调 onError: (error) => { + isSessionActive.value = false; console.error("WebSocket错误:", error); }, @@ -367,6 +368,10 @@ const initWebSocket = () => { // 处理WebSocket消息 const handleWebSocketMessage = (data) => { + if(loadingTimer) { + clearInterval(loadingTimer); + loadingTimer = null; + } const aiMsgIndex = chatMsgList.value.length - 1; if (!chatMsgList.value[aiMsgIndex] || aiMsgIndex < 0) { return;