拓恒河湖长制全民护河平台WEB端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.js 1.1KB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // app.js
  2. App({
  3. onLaunch() {
  4. // 展示本地存储能力
  5. const logs = wx.getStorageSync('logs') || []
  6. logs.unshift(Date.now())
  7. wx.setStorageSync('logs', logs)
  8. // 登录
  9. // wx.login({
  10. // success: res => {
  11. // 请求服务端获取用户openId
  12. // console.log(res);
  13. // wx.request({
  14. // url: 'url',
  15. // data: {
  16. // code: res.data
  17. // },
  18. // success(res) {
  19. // if (res.data.code === 1) {
  20. // wx.switchTab({
  21. // url: '/pages/home/index'
  22. // })
  23. // } else {
  24. // wx.showToast({
  25. // title: res.msg,
  26. // icon: 'error',
  27. // duration: 1500,
  28. // })
  29. // }
  30. // },
  31. // fail(e) {
  32. // wx.showToast({
  33. // title: '信息获取失败',
  34. // icon: 'error',
  35. // duration: 1500,
  36. // })
  37. // }
  38. // })
  39. // }
  40. // })
  41. },
  42. globalData: {
  43. userInfo: null
  44. }
  45. })