From 4d9ac4cfe9483fd9dc42fd52897b5fc85614a36e Mon Sep 17 00:00:00 2001 From: Ge Hao Date: Tue, 10 Jan 2017 17:33:15 +0800 Subject: [PATCH] bugfix --- app.js | 6 ++++-- utils/profile.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 765c312..7ac4372 100644 --- a/app.js +++ b/app.js @@ -8,8 +8,10 @@ App({ this.jsonModel = jsonApi.JsonApiDataStoreModel this.globalData.code = wx.getStorageSync('code') - this.getUserInfo(function(res) { - that.globalData.wechatUserType = res.data.wechat_user_type + this.getUserInfo(function() { + profileUtil.postEncryptedData(function(res){ + that.globalData.wechatUserType = res.data.wechat_user_type + }) }) this.request({ url: `${that.globalData.API_URL}/manage_features`, diff --git a/utils/profile.js b/utils/profile.js index 04e7160..3c47be3 100644 --- a/utils/profile.js +++ b/utils/profile.js @@ -58,7 +58,8 @@ function getPassCode (mobile, cb) { }) } -function postEncryptedData(resolve) { +function postEncryptedData (resolve) { + var app = getApp() app.request({ method: 'POST', url: `${app.globalData.API_URL}/sessions/wechat_user_type`,