This commit is contained in:
ailanyin
2023-05-29 10:05:24 +08:00
parent 45af378c51
commit e0550f9e91
5 changed files with 148 additions and 78 deletions

View File

@ -42,12 +42,21 @@ router.beforeEach((to, from, next) => {
});
})
.catch((err) => {
useUserStore()
.logOut()
.then(() => {
ElMessage.error(err);
next({ path: "/" });
});
if (err === "您已被挤下线") {
useUserStore()
.abnormalLogOut()
.then(() => {
ElMessage.error(err);
next({ path: "/" });
});
} else {
useUserStore()
.logOut()
.then(() => {
ElMessage.error(err);
next({ path: "/" });
});
}
});
} else {
next();