Browse Source

没有token时的回复添加打开弹窗链接

songjie/feature-20250628160649-上线前优化
no99 4 weeks ago
parent
commit
e0e0f6e37c
  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 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 = `<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",
type: "ing",
flag: flag,
content: AIcontent,
});
};
chatStore.messages.push(aiMsg);
chatStore.isLoading = false;
chatStore.chatInput = false;

4
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;
//

Loading…
Cancel
Save