修复
This commit is contained in:
@@ -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) || "登录失败";
|
||||
|
||||
Reference in New Issue
Block a user