This commit is contained in:
dekun
2026-05-30 16:01:35 +08:00
parent 979054546c
commit cdbe087202
6 changed files with 235 additions and 20 deletions
+10 -3
View File
@@ -51,6 +51,7 @@
body: JSON.stringify({
username: fd.get("username"),
password: fd.get("password"),
embed: window.self !== window.top ? "1" : "0",
}),
})
.then(function (r) {
@@ -59,9 +60,15 @@
});
})
.then(function (x) {
if (x.ok && x.body && x.body.redirect) {
window.location.href = x.body.redirect;
return;
if (x.ok && x.body) {
var dest =
window.self !== window.top && x.body.embed_auth_url
? x.body.embed_auth_url
: x.body.redirect || "/dashboard";
if (dest) {
window.location.href = dest;
return;
}
}
if (errEl) {
errEl.textContent = (x.body && x.body.detail) || "登录失败";