|
|
@ -15,35 +15,48 @@ |
|
|
|
this.initLogin(); |
|
|
|
this.initLogin(); |
|
|
|
this.closeLoading(loading); |
|
|
|
this.closeLoading(loading); |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 教师 学校管理员 超管 http://10.10.17.37:8080/#/yyyfLoginBack?userId=20776&userName=eWFuZmEwMw%3D%3D&userType=1&authorization=87DIVy348Oxzj3ha |
|
|
|
* 教师 学校管理员 超管 http://localhost:8080/#/yyyfLoginBack?userId=1&userName=eWFuZmEwMw%3D%3D&userType=1 |
|
|
|
* 1教师 2超管 3学校管理员 |
|
|
|
* 1教师 2超管 ==> 案例管理 |
|
|
|
|
|
|
|
* 3学校管理员 ==> 后台管理 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
initLogin() { |
|
|
|
initLogin() { |
|
|
|
let params = Utils.parseUrl(); |
|
|
|
let params = Utils.parseUrl(); |
|
|
|
let userType = params.userType; |
|
|
|
let self = this; |
|
|
|
Login.yyyfLogin(params).then(res => { |
|
|
|
//判断是否来自以渔有方 |
|
|
|
let {msg, code} = res; |
|
|
|
if (params!==undefined && params !=null && params.userId != undefined && params.userType != undefined) { |
|
|
|
if (code !== 200) { |
|
|
|
let userType = params.userType; |
|
|
|
this.$message({ |
|
|
|
Login.yyyfLogin(params).then(res => { |
|
|
|
message: msg, |
|
|
|
let {msg, code} = res; |
|
|
|
type: 'error' |
|
|
|
if (code !== 200) { |
|
|
|
}); |
|
|
|
self.$message({ |
|
|
|
} else { |
|
|
|
message: msg, |
|
|
|
sessionStorage.setItem('user', JSON.stringify(res.data)); |
|
|
|
type: 'error' |
|
|
|
sessionStorage.setItem('account',res.data.account); |
|
|
|
}); |
|
|
|
sessionStorage.setItem('token', res.data.token); |
|
|
|
} else { |
|
|
|
if (userType == 1 || userType == 2) {//教师、超管 |
|
|
|
sessionStorage.setItem('user', JSON.stringify(res.data)); |
|
|
|
this.$router.push({path: '/train'}); |
|
|
|
sessionStorage.setItem('account',res.data.account); |
|
|
|
}else{ |
|
|
|
sessionStorage.setItem('token', res.data.token); |
|
|
|
this.$router.replace({path: '/'}); |
|
|
|
if (userType == 1 || userType == 2) {//教师、超管 |
|
|
|
} |
|
|
|
self.$router.push({path: '/train'}); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
window.location.reload(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
self.$alert('参数错误', '提示', { |
|
|
|
|
|
|
|
type: 'error', |
|
|
|
|
|
|
|
showClose: false, |
|
|
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
|
|
confirmButtonClass: 'btn-self-style', |
|
|
|
|
|
|
|
callback: action => { |
|
|
|
|
|
|
|
self.closeWindow() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
//Loading加载 |
|
|
|
//Loading加载 |
|
|
|
openLoading() { |
|
|
|
openLoading() { |
|
|
@ -58,6 +71,16 @@ |
|
|
|
closeLoading(loading){ |
|
|
|
closeLoading(loading){ |
|
|
|
loading.close(); |
|
|
|
loading.close(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
closeWindow: function () { |
|
|
|
|
|
|
|
if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") != -1) { |
|
|
|
|
|
|
|
window.location.href = "about:blank"; |
|
|
|
|
|
|
|
window.close(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
window.opener = null; |
|
|
|
|
|
|
|
window.open("", "_self"); |
|
|
|
|
|
|
|
window.close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|