// app.js App({ onLaunch() { // 展示本地存储能力 const logs = wx.getStorageSync('logs') || [] logs.unshift(Date.now()) wx.setStorageSync('logs', logs) // 登录 // wx.login({ // success: res => { // 请求服务端获取用户openId // console.log(res); // wx.request({ // url: 'url', // data: { // code: res.data // }, // success(res) { // if (res.data.code === 1) { // wx.switchTab({ // url: '/pages/home/index' // }) // } else { // wx.showToast({ // title: res.msg, // icon: 'error', // duration: 1500, // }) // } // }, // fail(e) { // wx.showToast({ // title: '信息获取失败', // icon: 'error', // duration: 1500, // }) // } // }) // } // }) }, globalData: { userInfo: null } })