Merge branch 'wechat_user_type'

code
Ge Hao 7 years ago
commit a400060d5a
  1. 21
      app.js
  2. 17
      utils/profile.js

@ -8,7 +8,11 @@ App({
this.jsonModel = jsonApi.JsonApiDataStoreModel
this.globalData.code = wx.getStorageSync('code')
this.getUserInfo()
this.getUserInfo(function() {
that.postEncryptedData(function(res){
that.globalData.wechatUserType = res.data.wechat_user_type
})
})
this.request({
url: `${that.globalData.API_URL}/manage_features`,
success: function(res) { that.globalData.featureManager = res.data }
@ -121,7 +125,22 @@ App({
}
},
postEncryptedData: function (resolve) {
this.request({
method: 'POST',
url: `${this.globalData.API_URL}/sessions/wechat_user_type`,
data: {
code: this.globalData.code,
encrypted: this.globalData.encrypted,
userInfo: this.globalData.userInfo
},
success: resolve,
fail: function(res) {}
})
},
globalData:{
wechatUserType: 'normal',
featureManager: {},
userInfo: null,
currentCustomer: null,

@ -1,6 +1,6 @@
const app = getApp()
function getZichanSlides (resolve) {
export function getZichanSlides (resolve) {
app.authRequest({
url: `${app.globalData.API_URL}/my_assets`,
header: { 'Content-Type': 'application/json'},
@ -9,7 +9,7 @@ function getZichanSlides (resolve) {
})
}
function postCustomerInfo (data, cb) {
export function postCustomerInfo (data, cb) {
data['code'] = app.globalData.code
data['encrypted'] = app.globalData.encrypted
app.request({
@ -45,7 +45,7 @@ function postCustomerInfo (data, cb) {
})
}
function getPassCode (mobile, cb) {
export function getPassCode (mobile, cb) {
app.request({
url: `${app.globalData.API_URL}/send_validation_code/send_message`,
header: { 'Content-Type': 'application/json'},
@ -58,14 +58,3 @@ function getPassCode (mobile, cb) {
})
}
module.exports = {
getZichanSlides (resolve) {
return getZichanSlides(resolve)
},
postCustomerInfo (data, resolve) {
return postCustomerInfo(data, resolve)
},
getPassCode (mobile, cb) {
return getPassCode(mobile, cb)
}
}
Loading…
Cancel
Save