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; // 清理图表交互相关的定时器和全局函数