🎨401跳转回登陆

This commit is contained in:
coward 2024-06-18 15:43:58 +08:00
parent e51d4445cf
commit 7c3410831b

View File

@ -163,6 +163,14 @@ class PureHttp {
resolve(response); resolve(response);
}) })
.catch(error => { .catch(error => {
if (error.response.status === 401) {
router.replace({
path: "/login",
query: {
redirect: router.currentRoute.value.fullPath
}
});
}
if (error.response === null || error.response === undefined) { if (error.response === null || error.response === undefined) {
message(error.message, { type: "error" }); message(error.message, { type: "error" });
} else { } else {