From dcb839d20f650e47766c6e0269876dd465cbf114 Mon Sep 17 00:00:00 2001 From: luobz Date: Thu, 14 Jun 2018 12:13:40 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81fix=E7=99=BB=E5=BD=95=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/login/login.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pages/login/login.js b/pages/login/login.js index c4e50d1..25d9413 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -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,