app.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import * as httpUtil from "./utils/httpUtil";
  2. import $checkRes from './utils/checkRes';
  3. const app = getApp();
  4. App({
  5. onLaunch() {
  6. // 展示本地存储能力
  7. const logs = wx.getStorageSync('logs') || []
  8. logs.unshift(Date.now())
  9. wx.setStorageSync('logs', logs)
  10. //获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度
  11. wx.getSystemInfo({
  12. success: (res) => {
  13. let data = res;
  14. data.getMenu = wx.getMenuButtonBoundingClientRect();
  15. this.globalData.client = data;
  16. }
  17. })
  18. },
  19. globalData: {
  20. // 用户信息
  21. userInfo: {},
  22. // 微信用户openid,sessionKey
  23. wxInfo: {},
  24. icon: 'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132',
  25. // 当前设备信息
  26. client: {},
  27. // 数据请求接口域名
  28. publicUrl: 'https://broadcast.waityou24.cn',
  29. //图片请求接口域名
  30. fileUrl: "https://broadcast.waityou24.cn",
  31. },
  32. ...httpUtil,
  33. $checkRes
  34. })