//app.js emlog博客小程序作者QQ：809666838，AIR娱乐网www.airzyw.com制作，请保留该版权！
import util from './utils/util.js'
App({
  onLaunch: function(e) {
    console.log('onLaunch', e);
  },
  getSetting: function(cb) {
    let setting = this.globalData.setting;
    if (setting) {
      typeof cb === 'function' ? cb(setting) : setting;
      return true;
    }
    util.getSettings(success => {
      this.globalData.setting = success;
      typeof cb === 'function' ? cb(success) : setting;
    });
  },
  globalData: {
    setting: null
  }
})