diff --git a/index.html b/index.html index 9c849b3..b26b7bf 100755 --- a/index.html +++ b/index.html @@ -1609,7 +1609,6 @@ const weixinloading = document.querySelector(".weixin-loading") let controller = null; let sessIdList = []; - let openId = ''; let isStopped = false;//是否停止输出 let isUpload = {}; let hasImage = false; @@ -1621,6 +1620,8 @@ console.log(params.get("userId"), 644, params.get("nickname"), params.get("headingimg")); const encodedUserId = params.get("userId"); + let openId= params.get("openid")?params.get("openid"):''; + const from = params.get("from"); let token = params.get("token");//app的token let localtoken = params.get("localtoken");//公众号的localtoken @@ -1748,6 +1749,7 @@ // setCookie('token', res.token); unshowpop(); // getSessionList(); + refreshAiChatNum() } // } else { @@ -2044,6 +2046,7 @@ if (!sessIdList || sessIdList.length == 0) { activeChatId = null; chatMessages.innerHTML = ""; + weixinloading.classList.add("none"); return; } // if (isNew == "new") { @@ -2724,6 +2727,17 @@ } } + async function refreshAiChatNum() { + const data = { + userId: userId + } + const res = await fetch("https://serviceai.satabot.com/refreshAiChatNum", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(data) // ✅ 加上 signal + }); + } + function showpop() { let html = `