From 65218f131734c7a1e8eead932ba51c6aac025d35 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Fri, 13 Oct 2023 13:54:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/chat/index.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/chat/index.vue b/src/views/chat/index.vue index 6193531..9b53a69 100644 --- a/src/views/chat/index.vue +++ b/src/views/chat/index.vue @@ -147,6 +147,11 @@ async function onConversation() { // 监听WebSocket关闭事件 socket.onclose = (event: any) => { console.log('连接已关闭: ', event) + nowStauts.value = 'input' + } + socket.onerror = (event: any) => { + console.log('连接出错: ', event) + nowStauts.value = 'input' } if (loading.value) @@ -214,7 +219,6 @@ async function onConversation() { lastText += msg.payload.choices.text[0].content mp3.push(msg.payload.choices.mp3) const loading = true - nowStauts.value = 'input' updateChat( +uuid, dataSources.value.length - 1,