app.js 778 B

1234567891011121314151617181920212223242526
  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. },
  15. onLaunch(options) {
  16. UpdateManager.update();
  17. this.globalData.token = storage.getItem("token")
  18. const res = wx.getSystemInfoSync()
  19. this.globalData.isPC = (res.platform == "windows" || res.platform == 'mac')
  20. this.globalData.isPCDeviceUnkonw = (this.globalData.isPC && res.devicePixelRatio == res.pixelRatio && res.pixelRatio != 1);
  21. },
  22. Base: basePage,
  23. })