diff --git a/src/store/chat.js b/src/store/chat.js index 32d8fbc..376129c 100644 --- a/src/store/chat.js +++ b/src/store/chat.js @@ -23,6 +23,7 @@ export const useChatStore = defineStore("chat", { firstAPICall:false, dbqbScrollToTop:true, + allowTyping:false, }), actions: { async getUserCount() { diff --git a/src/store/deepNine.js b/src/store/deepNine.js index c4f3798..b00a6ca 100644 --- a/src/store/deepNine.js +++ b/src/store/deepNine.js @@ -23,6 +23,7 @@ export const useDeepNineStore = defineStore("deepNine", { firstAPICall:false, dbqbScrollToTop:true, + allowTyping:false, }), actions: { async getUserCount() { diff --git a/src/views/AIchat.vue b/src/views/AIchat.vue index d0bcdf6..1603391 100644 --- a/src/views/AIchat.vue +++ b/src/views/AIchat.vue @@ -949,7 +949,9 @@ const processTypingQueue = async () => { while (typingQueue.value.length > 0) { const task = typingQueue.value.shift(); - await createTypingEffect(task.message, task.content, task.speed); + if (chatStore.allowTyping) { + await createTypingEffect(task.message, task.content, task.speed); + } } isTypingInProgress.value = false; @@ -1144,6 +1146,7 @@ watch( // 第一阶段,意图识别 try { + chatStore.allowTyping = true; // 调用工作流获取回复 const result = await dbqbFirstAPI(params1); codeData.value = result.data; @@ -2576,6 +2579,7 @@ watch( // 3. 停止打字机效果 typingQueue.value = []; isTypingInProgress.value = false; + chatStore.allowTyping = false; // 4. 重置加载状态 chatStore.isLoading = false; diff --git a/src/views/deepNine.vue b/src/views/deepNine.vue index 752291f..283df46 100644 --- a/src/views/deepNine.vue +++ b/src/views/deepNine.vue @@ -870,7 +870,9 @@ const processTypingQueue = async () => { while (typingQueue.value.length > 0) { const task = typingQueue.value.shift(); - await createTypingEffect(task.message, task.content, task.speed); + if (chatStore.allowTyping) { + await createTypingEffect(task.message, task.content, task.speed); + } } isTypingInProgress.value = false; @@ -1065,6 +1067,7 @@ watch( // 第一阶段,意图识别 try { + chatStore.allowTyping = true; // 调用工作流获取回复 const result = await deepNineFirstAPI(params1); codeData.value = result.data; @@ -1956,6 +1959,7 @@ watch( // 3. 停止打字机效果 typingQueue.value = []; isTypingInProgress.value = false; + chatStore.allowTyping = false; // 4. 重置加载状态 homepageChatStore.isLoading = false; @@ -2181,7 +2185,7 @@ watch( content: "该内容由AI生成,请注意甄别", end: true, }); - + } catch (e) { ElMessage.error("历史数据获取出错!"); console.error("e", e);