diff options
Diffstat (limited to 'src/router/index.ts')
-rw-r--r-- | src/router/index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/router/index.ts b/src/router/index.ts index 496f5d0..32a2962 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -85,8 +85,9 @@ const router = createRouter({ }) router.beforeEach((to, _, next) => { + console.log(to.fullPath) if (to.meta.isAuth && !localStorage.getItem('authToken')) { - next('/login?redirected=true') + next(`/login?redirect=${to.fullPath}`) } else { next() } |