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
@ -58,7 +58,15 @@ function __login() {
|
||||
} else if (http.status === 403) {
|
||||
wm.error("Invalid username or password").then(__tryAgain);
|
||||
} else {
|
||||
wm.error("Login error:<br>", http.responseText).then(__tryAgain);
|
||||
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 {
|
||||
wm.error("Login error:<br>", http.responseText).then(__tryAgain);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, body, "application/x-www-form-urlencoded");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user