|
@@ -28,7 +28,8 @@
|
|
|
return {
|
|
|
isCorpWX:false,
|
|
|
isWX:false,
|
|
|
- user: JSON.parse(localStorage.userInfo),
|
|
|
+ // user: JSON.parse(localStorage.userInfo) || '',
|
|
|
+ user: '',
|
|
|
unreadNum:0,
|
|
|
images: [
|
|
|
// require('../../assets/img/index/banner_1.png'),
|
|
@@ -39,16 +40,19 @@
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ if(localStorage.userInfo) {
|
|
|
+ this.user = JSON.parse(localStorage.userInfo)
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
// 手机上看控制台
|
|
|
- // if(this.user.companyName == '比基尼小镇'){
|
|
|
- // let consoleScript = document.createElement("script");
|
|
|
- // consoleScript.src = "https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js";
|
|
|
- // consoleScript.onload = function () {
|
|
|
- // new VConsole()
|
|
|
- // }
|
|
|
- // document.head.appendChild(consoleScript);
|
|
|
+ // if(this.user.companyId == '7'){
|
|
|
+ // let consoleScript = document.createElement("script");
|
|
|
+ // consoleScript.src = "https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js";
|
|
|
+ // consoleScript.onload = function () {
|
|
|
+ // new VConsole()
|
|
|
+ // }
|
|
|
+ // document.head.appendChild(consoleScript);
|
|
|
// }
|
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
|
if (ua.indexOf("wxwork") > 0) {
|
|
@@ -60,7 +64,11 @@
|
|
|
if (localStorage.userInfo != null) {
|
|
|
that.getAccountInfo();
|
|
|
} else {
|
|
|
- this.$router.push("/login");
|
|
|
+ if(window.location.href.indexOf('userId') != '-1') {
|
|
|
+ that.getAccountInfo()
|
|
|
+ } else {
|
|
|
+ this.$router.push("/login");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -218,7 +226,7 @@
|
|
|
this.user = res.data;
|
|
|
this.getModule()
|
|
|
this.getMessage();
|
|
|
- this.bindIfNessary();
|
|
|
+ // this.bindIfNessary();
|
|
|
}
|
|
|
}).catch(err=> {
|
|
|
alert('err=' + err);
|