Browse Source

app解决未通过验证码登录问题

娄底高职分支
yxq 9 months ago
parent
commit
d6ea722299
1 changed files with 21 additions and 15 deletions
  1. +21
    -15
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue

+ 21
- 15
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/login.vue View File

@@ -94,6 +94,8 @@
devAccountList: [],

resData: {},
loginResult:{},
logininfo:{},
isCode: false,
mobile: '',
verifycode: '',
@@ -220,14 +222,16 @@
})
if (postResult[1].data.code == '200') {
loginResult = postResult[1].data.data;
this.loginResult = loginResult
var logininfo = {
account: loginResult.baseinfo.account,
token: loginResult.baseinfo.token,
date: moment().format('yyyy-MM-dd hh:mm:ss')
};
this.SET_STORAGE("token", loginResult.baseinfo.token)
this.SET_STORAGE('logininfo', logininfo);
this.SET_STORAGE('userinfo', loginResult.baseinfo);
this.logininfo = logininfo
// this.SET_STORAGE("token", loginResult.baseinfo.token)
// this.SET_STORAGE('logininfo', logininfo);
// this.SET_STORAGE('userinfo', loginResult.baseinfo);
this.username = ""
this.password = ""
if (loginResult.pwd === true) {
@@ -304,12 +308,6 @@
}
}, 1000);
if (baseinfo.Description == '学生') {
this.SET_STORAGE("tokenExpireTime", new Date().valueOf()+86400000*30)
}else{
this.SET_STORAGE("tokenExpireTime", new Date().valueOf()+86400000*7)
}

return
// }

@@ -347,18 +345,26 @@
mobile: this.mobile,
verifycode: this.verifycode
})
if (!codeResult || !codeResult[1] || !codeResult[1].data) {
return
}
if (!codeResult[1].data.code || codeResult[1].data.code != 200) {
this.TOAST(codeResult[1].data.info);
return
// if (!codeResult || !codeResult[1] || !codeResult[1].data) {
// return
// }
// if (!codeResult[1].data.code || codeResult[1].data.code != 200) {
// this.TOAST(codeResult[1].data.info);
// return
// }
if (this.loginResult.baseinfo.Description == '学生') {
this.SET_STORAGE("tokenExpireTime", new Date().valueOf()+86400000*30)
}else{
this.SET_STORAGE("tokenExpireTime", new Date().valueOf()+86400000*7)
}

this.SET_GLOBAL('token', this.resData.token)
this.SET_GLOBAL('loginUser', this.resData.user)
this.SET_STORAGE("logintime", this.resData.user.logTime);
this.SET_STORAGE('token', this.resData.token)
this.SET_STORAGE('logininfo', this.logininfo);
this.SET_STORAGE('userinfo', this.loginResult.baseinfo);
this.TAB_TO('/pages/home')
this.HIDE_LOADING()
},


Loading…
Cancel
Save