app.js 994 B

12345678910111213141516171819202122232425262728293031323334
  1. // app.js
  2. import storage from "./utils/storage";
  3. import basePage from "./utils/baseListPage";
  4. import UpdateManager from './model/update-manager.js';
  5. import Config from "./model/config";
  6. console.log = Config.LOG_ENABLE ? console.log : () => {
  7. };
  8. App({
  9. globalData: {
  10. userInfo: null,
  11. token: "",
  12. isPC: false,
  13. isPCDeviceUnkonw: false,
  14. systemInfo: null,
  15. },
  16. onLaunch(options) {
  17. // UpdateManager.update();
  18. this.globalData.token = storage.getItem("token")
  19. const res = wx.getSystemInfoSync()
  20. this.globalData.isPC = (res.platform == "windows" || res.platform == 'mac')
  21. this.globalData.isPCDeviceUnkonw = (this.globalData.isPC && res.devicePixelRatio == res.pixelRatio && res.pixelRatio != 1);
  22. wx.getSystemInfo({
  23. success: (result) => {
  24. this.globalData.systemInfo = result;
  25. },
  26. })
  27. },
  28. onShow(){
  29. UpdateManager.update();
  30. },
  31. Base: basePage,
  32. })