From 21961fc37ba8715af487aaf42714d8e6550310f1 Mon Sep 17 00:00:00 2001 From: Ge Hao Date: Tue, 20 Dec 2016 14:59:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0feature=20manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 66843f2..b2287a7 100644 --- a/app.js +++ b/app.js @@ -3,11 +3,16 @@ require('utils/polyfill.js') App({ onLaunch: function () { + var that = this this.store = new(jsonApi.JsonApiDataStore) this.jsonModel = jsonApi.JsonApiDataStoreModel this.globalData.code = wx.getStorageSync('code') this.getUserInfo() + this.request({ + url: `${that.globalData.API_URL}/manage_features`, + success: function(res) { that.globalData.featureManager = res.data } + }) }, getUserInfo: function (cb) { @@ -40,7 +45,7 @@ App({ header['Content-Type'] = 'application/json' } if (!header['Authorization']) { - header['Authorization'] = getApp().globalData.token + header['Authorization'] = this.globalData.token } // This must be wx.request ! @@ -115,6 +120,7 @@ App({ }, globalData:{ + featureManager: {}, userInfo: null, currentCustomer: null, // API_URL: 'http://localhost:3000',