mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
Fixed pikvm/pikvm#48
This commit is contained in:
parent
5edb85975f
commit
f84d83e270
@ -57,10 +57,18 @@ function __login() {
|
|||||||
document.location.href = "/";
|
document.location.href = "/";
|
||||||
} else if (http.status === 403) {
|
} else if (http.status === 403) {
|
||||||
wm.error("Invalid username or password").then(__tryAgain);
|
wm.error("Invalid username or password").then(__tryAgain);
|
||||||
|
} else {
|
||||||
|
let error = "";
|
||||||
|
if (http.status === 400) {
|
||||||
|
try { error = JSON.parse(http.responseText)["result"]["error"]; } catch (_) { /* Nah */ }
|
||||||
|
}
|
||||||
|
if (error === "ValidatorError") {
|
||||||
|
wm.error("Incorrect username characters").then(__tryAgain);
|
||||||
} else {
|
} else {
|
||||||
wm.error("Login error:<br>", http.responseText).then(__tryAgain);
|
wm.error("Login error:<br>", http.responseText).then(__tryAgain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, body, "application/x-www-form-urlencoded");
|
}, body, "application/x-www-form-urlencoded");
|
||||||
__setEnabled(false);
|
__setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user