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)