app.js 819 B

123456789101112131415161718192021222324252627
  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. //TODO studentbook 和 live需要处理
  7. console.log = Config.LOG_ENABLE ? console.log : () => {
  8. };
  9. App({
  10. globalData: {
  11. userInfo: null,
  12. token: "",
  13. isPC: false,
  14. isPCDeviceUnkonw: false,
  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. },
  23. Base: basePage,
  24. })