|
|
|
@ -114,8 +114,8 @@ Page({ |
|
|
|
}, |
|
|
|
bindFormSubmit: function (e) {//点击登录事件监听
|
|
|
|
let that = this; |
|
|
|
let mobile = e.detail.value.mobile; |
|
|
|
let code = e.detail.value.code; |
|
|
|
let mobile = this.data.mobile; |
|
|
|
let code = this.data.code; |
|
|
|
let str = JSON.stringify(e.currentTarget.dataset.item); |
|
|
|
var pages = getCurrentPages(); |
|
|
|
var currPage = pages[pages.length - 1]; //当前页面
|
|
|
|
@ -139,8 +139,8 @@ Page({ |
|
|
|
// 可以将 res 发送给后台解码出 unionId
|
|
|
|
app.globalData.userInfo = res.userInfo |
|
|
|
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
|
|
|
if (that.globalData.openid != undefined && that.globalData.openid !=""){ |
|
|
|
that.commitUserInfo(that.globalData.openid, res.encryptedData, res.iv); |
|
|
|
if (app.globalData.openid != undefined && app.globalData.openid !=""){ |
|
|
|
that.commitUserInfo(app.globalData.openid, res.encryptedData, res.iv); |
|
|
|
}; |
|
|
|
|
|
|
|
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
|
|
|
|
@ -206,9 +206,8 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
commitUserInfo: function (openid, encryptedData, iv) { |
|
|
|
var that = this; |
|
|
|
wx.request({ |
|
|
|
url: this.gw.hostUrl + '/mall/wxa/auth/userinfo', |
|
|
|
url: app.gw.hostUrl + '/mall/wxa/auth/userinfo', |
|
|
|
method: 'POST', |
|
|
|
data: { |
|
|
|
openid: openid, |
|
|
|
|