huangbin 4 tahun lalu
induk
melakukan
156be18b62
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      src/router/index.ts

+ 3 - 2
src/router/index.ts

@@ -876,7 +876,8 @@ router.beforeEach((to, from, next) => {
             const password = 'd41efe629f9ed46baaa8f1ced2de518c645060e1965807776334820e55ce07c2'
             if (!getLoadIsComplete()) { // 没有加载对应的资料,表示第一次启动项目
                 console.log('to', to);
-                const { ACCOUNT, PASSWORD, name } = to.query
+                const { ACCOUNT, PASSWORD } = to.query
+                const name = to.name ? to.name : 'home'
                 if (ACCOUNT && PASSWORD) {
                     setLoadComplete(false)
                     globalDataRefresh().then(() => {
@@ -885,7 +886,7 @@ router.beforeEach((to, from, next) => {
                             setLoadComplete(true)
                             localStorageUtil.setItem('loginAccount', ACCOUNT); // 缓存登录账号
                             eventBus.$emit('loginSuccess', true);
-                            next({ name: name as string })
+                            next({ name })
                         }).catch(err => {
                             console.log('err', err);
                         })