Lijy 2 роки тому
батько
коміт
cea9673499

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

@@ -41,6 +41,7 @@
         created() {
         },
         mounted() {
+            // 手机上看控制台
             // if(this.user.companyName == '比基尼小镇'){
                 // let consoleScript = document.createElement("script");
                 // consoleScript.src = "https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js";
@@ -49,7 +50,6 @@
                 // }
                 // document.head.appendChild(consoleScript);
             // }
-            // console.log('userNameNeedTranslate',window.location.href);
             var ua = navigator.userAgent.toLowerCase();
             if (ua.indexOf("wxwork") > 0) {
                 this.isCorpWX = true;
@@ -58,16 +58,11 @@
             }
             let that = this
             if (localStorage.userInfo != null) {
-                // if(that.user.companyId == '7') {
-                //     alert('进来了')
-                // }
                 that.getAccountInfo();
             } else {
                 this.$router.push("/login");
             }
-            that.getModule()
-            that.getMessage();
-            that.bindIfNessary();
+           
         },
         components: {
             Footer
@@ -197,11 +192,6 @@
 
             //获取账户信息
             getAccountInfo() {
-                    // alert(window.location.href)
-
-                // if(this.user.companyId == '7') {
-                //     alert(window.location.href)
-                // }
                 let userId = this.user.id
                 if(window.location.href.indexOf('userId') != '-1') {
                     let href = window.location.href;
@@ -226,6 +216,9 @@
                     } else {
                         localStorage.userInfo = JSON.stringify(res.data);
                         this.user = res.data;
+                        this.getModule()
+                        this.getMessage();
+                        this.bindIfNessary();
                     } 
                 }).catch(err=> {
                     alert('err=' + err);