添加feature manager

wechat_user_type
Ge Hao 8 years ago
parent 36644f8eb3
commit 21961fc37b
  1. 8
      app.js

@ -3,11 +3,16 @@ require('utils/polyfill.js')
App({ App({
onLaunch: function () { onLaunch: function () {
var that = this
this.store = new(jsonApi.JsonApiDataStore) this.store = new(jsonApi.JsonApiDataStore)
this.jsonModel = jsonApi.JsonApiDataStoreModel this.jsonModel = jsonApi.JsonApiDataStoreModel
this.globalData.code = wx.getStorageSync('code') this.globalData.code = wx.getStorageSync('code')
this.getUserInfo() this.getUserInfo()
this.request({
url: `${that.globalData.API_URL}/manage_features`,
success: function(res) { that.globalData.featureManager = res.data }
})
}, },
getUserInfo: function (cb) { getUserInfo: function (cb) {
@ -40,7 +45,7 @@ App({
header['Content-Type'] = 'application/json' header['Content-Type'] = 'application/json'
} }
if (!header['Authorization']) { if (!header['Authorization']) {
header['Authorization'] = getApp().globalData.token header['Authorization'] = this.globalData.token
} }
// This must be wx.request ! // This must be wx.request !
@ -115,6 +120,7 @@ App({
}, },
globalData:{ globalData:{
featureManager: {},
userInfo: null, userInfo: null,
currentCustomer: null, currentCustomer: null,
// API_URL: 'http://localhost:3000', // API_URL: 'http://localhost:3000',

Loading…
Cancel
Save