|
@@ -195,11 +195,35 @@
|
|
|
alert('err=' + err);
|
|
|
});
|
|
|
},
|
|
|
+ automaticLogin(jobNumber, token) {
|
|
|
+ this.$axios.post("/user/loginAdminByThirdParty", {jobNumber:jobNumber, token:token})
|
|
|
+ .then(res => {
|
|
|
+ if(res.code == "ok") {
|
|
|
+ if(res.data.moduleList.length == 0){
|
|
|
+ this.$toast.fail(`请联系管理员 ${res.data.roleName} 分配权限`);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var user = res.data;
|
|
|
+ localStorage.userInfo = JSON.stringify(res.data);
|
|
|
+ this.$router.push("/index")
|
|
|
+ } else {
|
|
|
+ this.$toast.fail(res.msg);
|
|
|
+ }
|
|
|
+ }).catch(err=> {this.$toast.clear();});
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
if (localStorage.userInfo != null) {
|
|
|
this.$router.push("/index").catch(err => { console.log(err, '错误4')});
|
|
|
}
|
|
|
+
|
|
|
+ // 米莱的用工号登录
|
|
|
+ let windowHerf = window.location.href
|
|
|
+ if(windowHerf.indexOf('?jobNumber') != '-1') {
|
|
|
+ let jobNumber = windowHerf.split('jobNumber=')[1].split('&token=')[0]
|
|
|
+ let token = windowHerf.split('&token=')[1]
|
|
|
+ this.automaticLogin(jobNumber, token)
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
var ua = navigator.userAgent.toLowerCase();
|