// app.js import storage from "./utils/storage"; import basePage from "./utils/baseListPage"; import UpdateManager from './model/update-manager.js'; import Config from "./model/config"; console.log = Config.LOG_ENABLE ? console.log : () => { }; App({ globalData: { userInfo: null, token: "", isPC: false, isPCDeviceUnkonw: false, systemInfo: null, }, onLaunch(options) { // UpdateManager.update(); this.globalData.token = storage.getItem("token") const res = wx.getSystemInfoSync() this.globalData.isPC = (res.platform == "windows" || res.platform == 'mac') this.globalData.isPCDeviceUnkonw = (this.globalData.isPC && res.devicePixelRatio == res.pixelRatio && res.pixelRatio != 1); wx.getSystemInfo({ success: (result) => { this.globalData.systemInfo = result; }, }) }, onShow(){ UpdateManager.update(); }, Base: basePage, // 备注:为实现dayjs插件功能 需要在node_modules/dayjs/package.json,最外层添加代码 // "miniprogram": "esm", // import localeData from "dayjs/plugin/localeData" // dayjs.extend(localeData) // dayjs.locale('zh-cn') // dayjs.months()[dayjs().month()]//获取中文月份 // dayjs.locale('en') })