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

@@ -429,7 +429,11 @@
credentials: 'include',
method: "POST",
body: JSON.stringify(editedClient)
}).finally(() => {
})
.catch(err => {
alert(this.i18n.t('pin.save_client_error') + err);
})
.finally(() => {
setTimeout(() => {
this.refreshClients();
}, 1000);
@@ -518,6 +522,10 @@
} else {
this.clients = [];
}
})
.catch(e => {
console.error(e)
location.reload();
});
},
}