diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 3bfc9c2..4367907 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -29,7 +29,7 @@ Page({ bindSubmitMobile: function(e) { var mobile = this.data.mobile - var data = {mobile_code: this.data.mobile, code: e.detail.value.code} + var data = {mobile: this.data.mobile, mobile_code: e.detail.value.code} profile.getCustomerInfo(data, function(currentCustomer){ var baye_rank = currentCustomer.baye_rank diff --git a/utils/profile.js b/utils/profile.js index 43c545c..52ac6af 100644 --- a/utils/profile.js +++ b/utils/profile.js @@ -20,6 +20,10 @@ function getCustomerInfo (data, cb) { success: function(res) { app.globalData.currentCustomer = res.data.customer app.globalData.token = res.data.token + wx.setStorage({ + key: 'userToken', + data: res.data.token + }) typeof cb == "function" && cb(app.globalData.currentCustomer) }, fail: function(res) { @@ -46,8 +50,8 @@ module.exports = { getZichanSlides (resolve) { return getZichanSlides(resolve) }, - getCustomerInfo (resolve) { - return getCustomerInfo(resolve) + getCustomerInfo (data, resolve) { + return getCustomerInfo(data, resolve) }, getPassCode (mobile) { return getPassCode(mobile)