+ From 5741135f2ad890ce2f07acf7278d6df1e27a8a59 Mon Sep 17 00:00:00 2001 From: geyun <854914462@qq.com> Date: Thu, 15 Oct 2026 10:58:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E9=99=86=E7=95=8C=E9=9D=A2=20=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E7=BE=8E=E5=8C=96=20=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 15 + login.html | 1252 ++++++++++++++++++++++++++-------------------------- server2.js | 2 +- 3 files changed, 639 insertions(+), 630 deletions(-) diff --git a/index.html b/index.html index b2a0439..35bceb3 100755 --- a/index.html +++ b/index.html @@ -1886,6 +1886,18 @@ let token = params.get("token");//app的token let localtoken = params.get("localtoken");//公众号的localtoken + function clearOldRootDomainCookies() { + const names = ['Admin-Token', 'token', 'userId', 'username', 'nickname', 'headimgurl', 'headingimg']; + const parts = location.hostname.split('.'); + const rootDomain = parts.length >= 2 ? '.' + parts.slice(-2).join('.') : ''; + if (!rootDomain || rootDomain === '.') return; + names.forEach(name => { + document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=' + rootDomain + ';'; + }); + console.log('[cookie] 已清除旧 root-domain cookie:', rootDomain); + } + clearOldRootDomainCookies(); + // app会得到token; // 手机端会验证token @@ -2133,6 +2145,7 @@ console.error("请求异常:", err); } } + questions.forEach(q => { @@ -2214,6 +2227,8 @@ function logout() { deleteCookie('userId'); deleteCookie('token'); + deleteCookie('nickname'); + deleteCookie('headimgurl'); deleteCookie("sharetoken", "ai.satabot.com") // 清空历史记录(黑科技) history.pushState(null, null, location.href); diff --git a/login.html b/login.html index 4425b76..074dd2d 100644 --- a/login.html +++ b/login.html @@ -1,639 +1,633 @@ -
- - - - - -
+