登陆界面 样式美化 修复一些bug

This commit is contained in:
geyun
2026-10-15 10:58:43 +08:00
parent 8acce63d8f
commit 5741135f2a
3 changed files with 639 additions and 630 deletions

View File

@@ -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);

1252
login.html

File diff suppressed because it is too large Load Diff

View File

@@ -765,7 +765,7 @@ app.post("/user", async (req, res) => {
if (rows.length === 0) {
res.json({
code: 300,
error: "http://ri.satabot.com/#/login?goRemote=1",
error: "https://ai.satabot.com/login.html",
msg: "未找到该用户"
});
return;