数据太多,还是用post吧

wechat_user_type
Ge Hao 8 years ago
parent 335972a843
commit d6c789200d
  1. 8
      pages/mine/mine.js
  2. 7
      utils/profile.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) {

@ -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)

Loading…
Cancel
Save