Commit 4abfb26c by songbingqi

修复部分bug

parent 372ab1e2
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
}) })
}, },
loginDecrypt(res){ loginDecrypt(res){
const {faceInfoId} = res.data const {faceInfoId} = res
return uni.$u.http.post('/weixin/decrypt ', { return uni.$u.http.post('/weixin/decrypt ', {
session_key:res.loginInfo.session_key, session_key:res.loginInfo.session_key,
openId:res.loginInfo.openid, openId:res.loginInfo.openid,
...@@ -121,25 +121,26 @@ export default { ...@@ -121,25 +121,26 @@ export default {
}, },
// 手机号授权登录 // 手机号授权登录
getPhoneNumber(res, callback) { getPhoneNumber(res, callback) {
console.log(res)
uni.setStorage({ key: 'userPhoneInfo', data: res }); uni.setStorage({ key: 'userPhoneInfo', data: res });
Store.commit('setUserPhoneInfo', res); Store.commit('setUserPhoneInfo', res);
uni.setStorage({ key: 'phoneInfo', data: res }); uni.setStorage({ key: 'phoneInfo', data: res });
const loginInfo = res.loginInfo const loginInfo = res.loginInfo
const iv = res.detail.iv const iv = res.detail.iv
const data = res.detail.encryptedData const data = res.detail.encryptedData
if(res.faceInfoId){ const faceInfoId = res.faceInfoId
data.faceInfoId = res.faceInfoId // data.faceInfoId = String(res.faceInfoId)
} // if(res.faceInfoId){
// data.faceInfoId = res.faceInfoId
// }
wx.checkSession({ wx.checkSession({
success: (res) => { success: (res) => {
console.log('seeion未过期') console.log('seeion未过期')
this.onLogin(loginInfo,iv,data,callback) this.onLogin(loginInfo,iv,data,faceInfoId,callback)
}, },
fail: (res) => { fail: (res) => {
console.log('seeion已过期') console.log('seeion已过期')
this.wxLoginAndGetOpenid(true).then(loginInfo => { this.wxLoginAndGetOpenid(true).then(loginInfo => {
this.onLogin(loginInfo,iv,data,callback) this.onLogin(loginInfo,iv,data,faceInfoId,callback)
}) })
} }
}) })
...@@ -205,8 +206,8 @@ export default { ...@@ -205,8 +206,8 @@ export default {
context.showToast({ title: '服务器错误', icon: 'none' }); context.showToast({ title: '服务器错误', icon: 'none' });
}); });
}, },
onLogin(loginInfo,iv,data,callback) { onLogin(loginInfo,iv,data,faceInfoId,callback) {
this.loginDecrypt({loginInfo:JSON.parse(loginInfo),iv,data}).then(res => { this.loginDecrypt({loginInfo:JSON.parse(loginInfo),faceInfoId,iv,data}).then(res => {
const { statusCode, data } = res; const { statusCode, data } = res;
const { code, token, phoneNumber } = data; const { code, token, phoneNumber } = data;
if (statusCode == 200 && data && code == 200) { 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