import login from './utils/login';
import * as httpUtil from "./utils/httpUtil";
const app = getApp();
App({
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
    //获取设备顶部窗口的高度（不同设备窗口高度不一样，根据这个来设置自定义导航栏的高度
    wx.getSystemInfo({
      success: (res) => {
        let data = res;
        data.getMenu = wx.getMenuButtonBoundingClientRect();
        // console.log(data.statusBarHeight + data.getMenu.height + (data.getMenu.top - data.statusBarHeight)*2); 
        this.globalData.client = data
      }
    })

  },
  globalData: {
    userInfo: {},
    // 微信用户openid，sessionKey
    wxInfo: {},
    client: {},
    // 图片api
    imageUrl:'http://broadcast.waityou24.cn',
    publicUrl: 'http://broadcast.waityou24.cn', 
  },
  // 微信openid回调
  toLogin: login.toLogin,
  ...httpUtil
})
