mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
Disable page leave warning on unexpected logout
When already logged in, and an unexpected logout occurs, disable the page leave warning to prevent the unnecessary popup.
This commit is contained in:
@@ -190,6 +190,7 @@ export function Session() {
|
||||
__ws.onerror = __wsErrorHandler;
|
||||
__ws.onclose = __wsCloseHandler;
|
||||
} else if (http.status === 401 || http.status === 403) {
|
||||
window.onbeforeunload = () => null;
|
||||
wm.error("Unexpected logout occured, please login again").then(function() {
|
||||
document.location.href = "/login";
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user