Sfoglia il codice sorgente

调整登录报错

Lijy 3 anni fa
parent
commit
cb2d67f431

+ 5 - 5
fhKeeper/formulahousekeeper/timesheet_h5/src/views/login/index.vue

@@ -50,7 +50,7 @@
                         this.$store.commit("updateLogin", true);
                         localStorage.userInfo = JSON.stringify(user);
                         
-                        this.$router.push("/index");
+                        this.$router.push("/index").catch(err => { console.log(err, '错误1')});
                         //强制刷新,避免index页面中的mounted不执行
                         window.location.reload();
                     } else {
@@ -61,7 +61,7 @@
             },
             
             jumpTo() {
-                this.$router.push("/register");
+                this.$router.push("/register").catch(err => { console.log(err, '错误2')});
             },
 
             loginByCode(code, corpId) {
@@ -72,7 +72,7 @@
                                     this.$store.commit("updateLogin", true);
                                     localStorage.userInfo = JSON.stringify(user);
                                     
-                                    this.$router.push("/index");
+                                    this.$router.push("/index").catch(err => { console.log(err, '错误3')});
                                     //强制刷新,避免index页面中的mounted不执行
                                     // window.location.reload();
                                 } else {
@@ -187,7 +187,7 @@
         },
         created() {
             if (localStorage.userInfo != null) {
-                this.$router.push("/index");
+                this.$router.push("/index").catch(err => { console.log(err, '错误4')});
             }
         },
         mounted() {
@@ -198,7 +198,7 @@
                 this.isWX = true;
             }
             if (localStorage.userInfo != null) {
-                this.$router.push("/index");
+                this.$router.push("/index").catch(err => { console.log(err, '错误5')});
             } else {
                 if (this.isCorpWX || this.isWX) {
                     let href = window.location.href;