CzRger 4 днів тому
батько
коміт
9d4d5dc1b8
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      src/router/index.ts

+ 3 - 1
src/router/index.ts

@@ -61,7 +61,9 @@ router.beforeEach((to, from, next) => {
         if (localStorage.getItem((import.meta as any).env.VITE_TOKEN)) {
           AppStore.initUserInfo()
             .then(() => {
-              isLogin ? next({ name: 'root' }) : next(to.path)
+              isLogin
+                ? next({ name: 'root' })
+                : next({ path: to.path, query: to.query })
             })
             .catch((e) => {
               localStorage.removeItem((import.meta as any).env.VITE_TOKEN)