app.js 396 B

12345678910111213141516171819202122
  1. // app.js
  2. App({
  3. globalData:{
  4. name:""
  5. },
  6. onLaunch() {
  7. // 展示本地存储能力
  8. const logs = wx.getStorageSync('logs') || []
  9. logs.unshift(Date.now())
  10. wx.setStorageSync('logs', logs)
  11. // 登录
  12. wx.login({
  13. success: res => {
  14. // 发送 res.code 到后台换取 openId, sessionKey, unionId
  15. }
  16. })
  17. },
  18. globalData: {
  19. userInfo: null
  20. }
  21. })