app.js 904 B

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