fix: login expire auto redirect

This commit is contained in:
engigu
2024-01-08 19:45:14 +08:00
parent 63f6e93894
commit bffabe9b36
+3
View File
@@ -45,6 +45,9 @@ router.beforeEach((to, from, next) => {
const isAuthenticated = Boolean(localStorage.getItem(CONSTANT.STORE_TOKEN_NAME));
if (!isAuthenticated && to.path !== '/login') {
next('/login');
setTimeout(() => {
window.location.reload();
}, 100);
} else {
next();
}