fix: login expire auto redirect
This commit is contained in:
@@ -45,6 +45,9 @@ router.beforeEach((to, from, next) => {
|
|||||||
const isAuthenticated = Boolean(localStorage.getItem(CONSTANT.STORE_TOKEN_NAME));
|
const isAuthenticated = Boolean(localStorage.getItem(CONSTANT.STORE_TOKEN_NAME));
|
||||||
if (!isAuthenticated && to.path !== '/login') {
|
if (!isAuthenticated && to.path !== '/login') {
|
||||||
next('/login');
|
next('/login');
|
||||||
|
setTimeout(() => {
|
||||||
|
window.location.reload();
|
||||||
|
}, 100);
|
||||||
} else {
|
} else {
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user