Commit 4abfb26c by songbingqi

修复部分bug

parent 372ab1e2
......@@ -109,7 +109,7 @@ export default {
})
},
loginDecrypt(res){
const {faceInfoId} = res.data
const {faceInfoId} = res
return uni.$u.http.post('/weixin/decrypt ', {
session_key:res.loginInfo.session_key,
openId:res.loginInfo.openid,
......@@ -121,25 +121,26 @@ export default {
},
// 手机号授权登录
getPhoneNumber(res, callback) {
console.log(res)
uni.setStorage({ key: 'userPhoneInfo', data: res });
Store.commit('setUserPhoneInfo', res);
uni.setStorage({ key: 'phoneInfo', data: res });
const loginInfo = res.loginInfo
const iv = res.detail.iv
const data = res.detail.encryptedData
if(res.faceInfoId){
data.faceInfoId = res.faceInfoId
}
const faceInfoId = res.faceInfoId
// data.faceInfoId = String(res.faceInfoId)
// if(res.faceInfoId){
// data.faceInfoId = res.faceInfoId
// }
wx.checkSession({
success: (res) => {
console.log('seeion未过期')
this.onLogin(loginInfo,iv,data,callback)
this.onLogin(loginInfo,iv,data,faceInfoId,callback)
},
fail: (res) => {
console.log('seeion已过期')
this.wxLoginAndGetOpenid(true).then(loginInfo => {
this.onLogin(loginInfo,iv,data,callback)
this.onLogin(loginInfo,iv,data,faceInfoId,callback)
})
}
})
......@@ -205,8 +206,8 @@ export default {
context.showToast({ title: '服务器错误', icon: 'none' });
});
},
onLogin(loginInfo,iv,data,callback) {
this.loginDecrypt({loginInfo:JSON.parse(loginInfo),iv,data}).then(res => {
onLogin(loginInfo,iv,data,faceInfoId,callback) {
this.loginDecrypt({loginInfo:JSON.parse(loginInfo),faceInfoId,iv,data}).then(res => {
const { statusCode, data } = res;
const { code, token, phoneNumber } = data;
if (statusCode == 200 && data && code == 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment