|
@@ -42,17 +42,28 @@
|
|
|
},
|
|
|
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);
|
|
|
+ // 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);
|
|
|
// }
|
|
|
// console.log('userNameNeedTranslate',window.location.href);
|
|
|
+ var ua = navigator.userAgent.toLowerCase();
|
|
|
+ if (ua.indexOf("wxwork") > 0) {
|
|
|
+ this.isCorpWX = true;
|
|
|
+ } else if (ua.indexOf("micromessenger") > 0) {
|
|
|
+ this.isWX = true;
|
|
|
+ }
|
|
|
let that = this
|
|
|
if (localStorage.userInfo != null) {
|
|
|
+ // if(that.user.companyId == '7') {
|
|
|
+ // alert('进来了')
|
|
|
+ // }
|
|
|
that.getAccountInfo();
|
|
|
+ } else {
|
|
|
+ this.$router.push("/login");
|
|
|
}
|
|
|
that.getModule()
|
|
|
that.getMessage();
|
|
@@ -67,12 +78,6 @@
|
|
|
if(this.user.userNameNeedTranslate == '1'){
|
|
|
this.agentConfig()
|
|
|
}
|
|
|
- var ua = navigator.userAgent.toLowerCase();
|
|
|
- if (ua.indexOf("wxwork") > 0) {
|
|
|
- this.isCorpWX = true;
|
|
|
- } else if (ua.indexOf("micromessenger") > 0) {
|
|
|
- this.isWX = true;
|
|
|
- }
|
|
|
|
|
|
if (this.user.company.packageEngineering == 1) {
|
|
|
this.routers.push(
|
|
@@ -192,6 +197,11 @@
|
|
|
|
|
|
//获取账户信息
|
|
|
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;
|
|
@@ -204,7 +214,7 @@
|
|
|
if(window.location.href.indexOf('errorMsg') != '-1') {
|
|
|
let err = window.location.href.split('errorMsg=')[1]
|
|
|
let str = err.split('#/')[0]
|
|
|
- this.$router.push("/error");
|
|
|
+ this.$router.push("/login");
|
|
|
}
|
|
|
this.$axios.get('/user/loginByUserId', {params:{userId: userId}})
|
|
|
.then(res => {
|
|
@@ -214,7 +224,6 @@
|
|
|
//账号信息有问题,不能使用。
|
|
|
this.$router.push("/error");
|
|
|
} else {
|
|
|
-
|
|
|
localStorage.userInfo = JSON.stringify(res.data);
|
|
|
this.user = res.data;
|
|
|
}
|