From d6c789200d8a8d7bb0d59a9ed0b36e816c94a6af Mon Sep 17 00:00:00 2001 From: Ge Hao Date: Thu, 22 Dec 2016 14:57:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=AA=E5=A4=9A=EF=BC=8C?= =?UTF-8?q?=E8=BF=98=E6=98=AF=E7=94=A8post=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/mine.js | 8 ++++---- utils/profile.js | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 7adb64a..6bb5581 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -26,12 +26,12 @@ Page({ that.setData({userInfo: app.globalData.userInfo}) if (app.globalData.token) { - profile.getCustomerInfo({}, that.infoCallback) + profile.postCustomerInfo({}, that.infoCallback) } else { var token = wx.getStorageSync('userToken') if (token) { app.globalData.token = token - profile.getCustomerInfo({}, that.infoCallback) + profile.postCustomerInfo({}, that.infoCallback) } } @@ -101,14 +101,14 @@ Page({ bindLoginMobilecode: function(e) { if (!this.bindCheckMobile(this.data.mobile)) { return } var data = {mobile: this.data.mobile, mobile_code: e.detail.value.code, name: this.data.userInfo.nickName} - profile.getCustomerInfo(data, this.infoCallback) + profile.postCustomerInfo(data, this.infoCallback) }, bindLoginPassword: function(e) { var mobile = e.detail.value.mobile if (!this.bindCheckMobile(mobile)) { return } var data = {mobile: mobile, password: e.detail.value.password} - profile.getCustomerInfo(data, this.infoCallback) + profile.postCustomerInfo(data, this.infoCallback) }, changeLoginType: function(e) { diff --git a/utils/profile.js b/utils/profile.js index fc94180..6e70466 100644 --- a/utils/profile.js +++ b/utils/profile.js @@ -9,11 +9,12 @@ function getZichanSlides (resolve) { }) } -function getCustomerInfo (data, cb) { +function postCustomerInfo (data, cb) { data['code'] = app.globalData.code data['encrypted'] = app.globalData.encrypted app.request({ url: `${app.globalData.API_URL}/sessions/new`, + method: 'POST', data: data, success: function(res) { if (res.data.code === 4) { @@ -60,8 +61,8 @@ module.exports = { getZichanSlides (resolve) { return getZichanSlides(resolve) }, - getCustomerInfo (data, resolve) { - return getCustomerInfo(data, resolve) + postCustomerInfo (data, resolve) { + return postCustomerInfo(data, resolve) }, getPassCode (mobile, cb) { return getPassCode(mobile, cb)