diff --git a/ui/src/components/ai-chat/LogOperationButton.vue b/ui/src/components/ai-chat/LogOperationButton.vue index 4925c255c..493daf62c 100644 --- a/ui/src/components/ai-chat/LogOperationButton.vue +++ b/ui/src/components/ai-chat/LogOperationButton.vue @@ -102,7 +102,9 @@ function editMark(data: any) { const audioPlayerStatus = ref(false) const playAnswerText = (text: string) => { - console.log(props.data) + if (!text) { + text = '抱歉,没有查找到相关内容,请重新描述您的问题或提供更多信息。' + } if (props.tts_type === 'BROWSER') { // 创建一个新的 SpeechSynthesisUtterance 实例 const utterance = new SpeechSynthesisUtterance(text) diff --git a/ui/src/components/ai-chat/OperationButton.vue b/ui/src/components/ai-chat/OperationButton.vue index 651b69414..874570ef3 100644 --- a/ui/src/components/ai-chat/OperationButton.vue +++ b/ui/src/components/ai-chat/OperationButton.vue @@ -160,6 +160,9 @@ function markdownToPlainText(md: string) { } const playAnswerText = (text: string) => { + if (!text) { + text = '抱歉,没有查找到相关内容,请重新描述您的问题或提供更多信息。' + } // text 处理成纯文本 text = markdownToPlainText(text) if (props.tts_type === 'BROWSER') {