|
@@ -28,15 +28,18 @@ export default {
|
|
|
}
|
|
|
let wxtoken = sessionStorage.getItem('wxtoken');
|
|
|
if (!wxtoken) {
|
|
|
- window.location.href = `/wxtoken/auth?test=ocPqjswkUejZHq2ANriNrFFC7A3I&redirect_uri=${window.location.href}`; //学生:省外=>teststud1;省内=>lrf402788946:openid:ocPqjswkUejZHq2ANriNrFFC7A3I 企业:13089419810,testcorp1
|
|
|
+ // window.location.href = `/wxtoken/auth?test=13089419810&redirect_uri=${window.location.href}`; //学生:省外=>teststud1;省内=>lrf402788946:openid:ocPqjswkUejZHq2ANriNrFFC7A3I 企业:13089419810,testcorp1
|
|
|
} else {
|
|
|
- let result = await this.studLogin({ type: `1`, data: { wxtoken: wxtoken } }); //studLogin
|
|
|
- if (`${result.errcode}` !== '0') {
|
|
|
+ let type = sessionStorage.getItem('type');
|
|
|
+ let result;
|
|
|
+ if (type === 'corp') {
|
|
|
result = await this.corpLogin({ type: `1`, data: { wxtoken: wxtoken } });
|
|
|
- if (`${result.errcode}` !== '0') {
|
|
|
- this.setUser('none');
|
|
|
- return;
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ result = await this.studLogin({ type: `1`, data: { wxtoken: wxtoken } });
|
|
|
+ }
|
|
|
+ if (`${result.errcode}` !== '0') {
|
|
|
+ this.setUser('none');
|
|
|
+ return;
|
|
|
}
|
|
|
sessionStorage.setItem('token', result.data);
|
|
|
let info = jwt.decode(result.data);
|