Reload page instead of hard code to '/login' when requests failed

This commit is contained in:
Yukino Song
2024-09-21 01:02:31 +08:00
parent 5829bd1c76
commit 7e74405a97
5 changed files with 15 additions and 6 deletions

View File

@@ -148,7 +148,6 @@
this.refreshLogs();
}, 5000);
this.refreshLogs();
this.refreshClients();
},
beforeDestroy() {
clearInterval(this.logInterval);
@@ -190,14 +189,14 @@
})
.then((resp) => {
if (resp.status !== 200) {
location.href = './login'
location.reload();
return
}
})
.catch((e) => {
this.serverRestarting = false
location.href = './login'
console.error(e)
location.reload();
return
});
},