From a3c5d253b3ad754069019d60dad7b2f8e2e3ec8c Mon Sep 17 00:00:00 2001 From: cherishsince Date: Fri, 17 May 2024 18:07:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91Chat=20?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E6=BB=9A=E5=8A=A8=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?stream=E7=BB=93=E6=9D=9F=EF=BC=8C=E5=BC=80=E5=A7=8B=E5=8A=A0?= =?UTF-8?q?=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index b0a34483..e87f95c7 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -124,8 +124,9 @@ const textRoll = async () => { if (textRoleRunning.value) { return } + // 设置状态 textRoleRunning.value = true - + displayedText.value = '' const task = async () => { // 调整速度 const diff = (fullText.value.length - displayedText.value.length) / 10 @@ -138,6 +139,10 @@ const textRoll = async () => { } else { textSpeed.value = 100 } + // 对话结束,就按30的速度 + if (!conversationInProgress.value) { + textSpeed.value = 30 + } console.log(`diff ${diff} 速度 ${textSpeed.value} `) // console.log('index < fullText.value.length', index < fullText.value.length, conversationInProgress.value)