From e0e0f6e37c74f92bf465f339d5a9fba1615b514b Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Sat, 23 Aug 2025 14:52:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=A1=E6=9C=89token=E6=97=B6=E7=9A=84?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=B7=BB=E5=8A=A0=E6=89=93=E5=BC=80=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AIchat.vue | 15 +++++++++++---- src/views/homePage.vue | 4 ++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/views/AIchat.vue b/src/views/AIchat.vue index d54adf8..644924f 100644 --- a/src/views/AIchat.vue +++ b/src/views/AIchat.vue @@ -1187,7 +1187,7 @@ watch( const processedContent = marked(AIcontent.value); const katexRegex = /\$\$(.*?)\$\$/g; - const aiContent = processedContent.replace( + let aiContent = processedContent.replace( katexRegex, (match, formula) => { try { @@ -1198,14 +1198,21 @@ watch( } } ); - console.log(aiContent, "aiContent"); + console.log(AIcontent, "AIcontent"); - chatStore.messages.push({ + if (result.code == 406) { + AIcontent.value = `
尊敬的用户,目前您的token余额为0,系统将无法处理您的搜索请求,您可以补充token后再进行搜索。token兑换的入口在右上角“获取token次数”,点击即可操作哦~
`; + + } + + const aiMsg = { class: "ing", type: "ing", flag: flag, content: AIcontent, - }); + }; + + chatStore.messages.push(aiMsg); chatStore.isLoading = false; chatStore.chatInput = false; diff --git a/src/views/homePage.vue b/src/views/homePage.vue index f663f57..c564d90 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -1110,6 +1110,8 @@ onMounted(async () => { // updateAppHeight(); // 添加原生事件监听器 + window.showCountHandler = showCount; + window.addEventListener("resize", throttledJudgeDevice); window.receiveUniAppMessage = async function (messageData) { @@ -1157,6 +1159,8 @@ onUnmounted(() => { // 清理AiEmotion页面的高度监听器 stopAiEmotionHeightObserver(); + delete window.showCountHandler; + delete window.receiveUniAppMessage; // 清理图表交互相关的定时器和全局函数