由于可能需要对不同wechat用户做不同的页面效果,在进入时就获取敏感信息

然而我觉得还是需要两个 token 分别判断用户的微信账号和customer帐号(因为不推荐使用open_id来判断,这样就需要两个了)
wechat_user_type
Ge Hao 7 years ago
parent a2e44ebb47
commit 017cccb2b8
  1. 5
      app.js
  2. 18
      utils/profile.js

@ -8,7 +8,9 @@ App({
this.jsonModel = jsonApi.JsonApiDataStoreModel
this.globalData.code = wx.getStorageSync('code')
this.getUserInfo()
this.getUserInfo(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 }
@ -122,6 +124,7 @@ App({
},
globalData:{
wechatUserType: 'normal',
featureManager: {},
userInfo: null,
currentCustomer: null,

@ -58,6 +58,20 @@ function getPassCode (mobile, cb) {
})
}
function postEncryptedData(resolve) {
app.request({
method: 'POST',
url: `${app.globalData.API_URL}/sessions/wechat_user_type`,
data: {
code: app.globalData.code,
encrypted: app.globalData.encrypted,
userInfo: app.globalData.userInfo
},
success: resolve,
fail: function(res) {}
})
}
module.exports = {
getZichanSlides (resolve) {
return getZichanSlides(resolve)
@ -67,5 +81,9 @@ module.exports = {
},
getPassCode (mobile, cb) {
return getPassCode(mobile, cb)
},
postEncryptedData (resolve) {
return postEncryptedData(resolve)
}
}
Loading…
Cancel
Save