diff --git a/src/router/index.ts b/src/router/index.ts index 82a69c2..9193429 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -68,7 +68,7 @@ router.beforeEach((to, from) => { if (to.meta.auth == true) { // validate login state if (userStore.jwt_token == null) { - router.push({ path: "auth/login" }); + router.push({ name: "login" }); } } else { document.title = configStore.getAppName(); diff --git a/src/views/auth/Login.vue b/src/views/auth/Login.vue index 0116c9e..d9eccd7 100644 --- a/src/views/auth/Login.vue +++ b/src/views/auth/Login.vue @@ -102,7 +102,8 @@ const validate = () => { console.log(userStore.expired_at); setTimeout(() => { - window.location.href = "/"; + // window.location.href = "/"; + router.push("/"); }, 100); }