Browse Source

Merge branch 'milestone-20250710-上线前优化' of http://39.101.133.168:8807/hongxilin/AIxiaocaishen into songjie/feature-20250628160649-上线前优化

songjie/feature-20250628160649-上线前优化
宋杰 4 weeks ago
parent
commit
07fca30914
  1. 15
      src/views/AIchat.vue
  2. 4
      src/views/homePage.vue

15
src/views/AIchat.vue

@ -1187,7 +1187,7 @@ watch(
const processedContent = marked(AIcontent.value); const processedContent = marked(AIcontent.value);
const katexRegex = /\$\$(.*?)\$\$/g; const katexRegex = /\$\$(.*?)\$\$/g;
const aiContent = processedContent.replace(
let aiContent = processedContent.replace(
katexRegex, katexRegex,
(match, formula) => { (match, formula) => {
try { try {
@ -1198,14 +1198,21 @@ watch(
} }
} }
); );
console.log(aiContent, "aiContent");
console.log(AIcontent, "AIcontent");
chatStore.messages.push({
if (result.code == 406) {
AIcontent.value = `<p>尊敬的用户,目前您的token余额为0,系统将无法处理您的搜索请求,您可以补充token后再进行搜索。token兑换的入口在右上角“<span style="color:blue;cursor:pointer;border-bottom:1px solid blue" onclick="window.showCountHandler()">获取token次数</span>”,点击即可操作哦~</p>`;
}
const aiMsg = {
class: "ing", class: "ing",
type: "ing", type: "ing",
flag: flag, flag: flag,
content: AIcontent, content: AIcontent,
});
};
chatStore.messages.push(aiMsg);
chatStore.isLoading = false; chatStore.isLoading = false;
chatStore.chatInput = false; chatStore.chatInput = false;

4
src/views/homePage.vue

@ -1110,6 +1110,8 @@ onMounted(async () => {
// updateAppHeight(); // updateAppHeight();
// //
window.showCountHandler = showCount;
window.addEventListener("resize", throttledJudgeDevice); window.addEventListener("resize", throttledJudgeDevice);
window.receiveUniAppMessage = async function (messageData) { window.receiveUniAppMessage = async function (messageData) {
@ -1157,6 +1159,8 @@ onUnmounted(() => {
// AiEmotion // AiEmotion
stopAiEmotionHeightObserver(); stopAiEmotionHeightObserver();
delete window.showCountHandler;
delete window.receiveUniAppMessage; delete window.receiveUniAppMessage;
// //

Loading…
Cancel
Save