Compare commits
2 Commits
988a0aee34
...
feature/qw
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5741135f2a | ||
|
|
8acce63d8f |
15
index.html
15
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);
|
||||
|
||||
1251
login.html
1251
login.html
File diff suppressed because it is too large
Load Diff
@@ -750,7 +750,7 @@ app.post("/user", async (req, res) => {
|
||||
if (!userId && userId != "NaN") {
|
||||
res.json({
|
||||
code: 300,
|
||||
error: "http://ri.satabot.com/#/login?goRemote=1",
|
||||
error: "https://ai.satabot.com/login.html",
|
||||
msg: "未找到该用户"
|
||||
});
|
||||
return;
|
||||
@@ -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;
|
||||
@@ -836,7 +836,7 @@ app.get("/sessions", async (req, res) => {
|
||||
code: 300,
|
||||
// error:'https://gsgg.com'
|
||||
// error: "http://ri.satabot.com/#/dhhdghgbshwadhg"
|
||||
error: "http://ri.satabot.com/#/login?goRemote=1"
|
||||
error: "https://ai.satabot.com/login.html"
|
||||
});
|
||||
return;
|
||||
// return res.status(500).json({ code: 505, error: "http://1.95.137.212/#/login?redirect=%2Findex&goRemote=1" });
|
||||
|
||||
1
wxLogin.js
Normal file
1
wxLogin.js
Normal file
@@ -0,0 +1 @@
|
||||
!function (e, t) { e.WxLogin = function (o) { var n = "default"; !0 === o.self_redirect ? n = "true" : !1 === o.self_redirect && (n = "false"); var r = t.createElement("iframe"), s = (new Date).getTime(), a = "https://open.weixin.qq.com/connect/qrconnect?appid=" + o.appid + "&scope=" + o.scope + "&redirect_uri=" + o.redirect_uri + "&state=" + o.state + "&login_type=jssdk&self_redirect=" + n + "&styletype=" + (o.styletype || "") + "&sizetype=" + (o.sizetype || "") + "&bgcolor=" + (o.bgcolor || "") + "&rst=" + (o.rst || "") + "&ts=" + s; a += o.style ? "&style=" + o.style : "", a += o.href ? "&href=" + o.href : "", a += "en" === o.lang ? "&lang=en" : "", a += 1 === o.stylelite ? "&stylelite=1" : "", a += 0 === o.fast_login ? "&fast_login=0" : "", "auto" === o.color_scheme ? a += "&color_scheme=auto" : "dark" === o.color_scheme ? a += "&color_scheme=dark" : "light" === o.color_scheme && (a += "&color_scheme=light"), r.src = a, r.frameBorder = "0", r.allowTransparency = "true", r.scrolling = "no", r.width = "300px", r.height = "400px", r.allow = "local-network-access"; var c = t.getElementById(o.id); if (c.innerHTML = "", c.appendChild(r), e.addEventListener && e.JSON) { var i = function (t) { if ("https://open.weixin.qq.com" === t.origin) try { var n = JSON.parse(t.data); if (n && "status" === n.type) { var r = "wxReady" === n.status; r && o.onReady && "function" == typeof o.onReady && o.onReady(r), "wxQRcodeReady" === n.status && o.onQRcodeReady && "function" == typeof o.onQRcodeReady && o.onQRcodeReady() } } catch (t) { e.console && "function" == typeof e.console.log && e.console.log("wxLogin postMessage error", t) } }; e.addEventListener("message", i, !1); var l = !1; o.onCleanup = function () { !l && e.removeEventListener && (e.removeEventListener("message", i, !1), l = !0) } } } }(window, document);
|
||||
Reference in New Issue
Block a user