浏览代码

邀请参数

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)