// app.js const storageManager = require('/utils/storage-manager.js'); const api = require('./api/api.js'); App({ onLaunch() { wx.getSystemInfo({ success: (res) => { this.globalData.height = res.statusBarHeight }, }) }, globalData: { userInfo: null, height: 0 }, // 清空subPageResult缓存数据 async clearSubPageResult() { await storageManager.set("subPageResult", null) }, // 获取用户信息 getUserDetailInfo() { wx.request({ url: api.user_info, header: { 'Authorization': wx.getStorageSync('token') }, success(res) { console.log(res); if (res.data.code === 1) { wx.setStorageSync('userinfo', res.data.data); } } }) } })