app.js 533 B

12345678910111213141516171819202122232425262728
  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. console.log("code: "+res.code);
  12. wx.request({
  13. url: 'http://192.168.31.28:8084/user/login',
  14. method:'POST',
  15. data:{
  16. code : res.code,
  17. Appid: 'wxc25f00d0fc026ae7',
  18. AppSecret: '9e94011d65b0f4307b1cab14022ea060'
  19. }
  20. })
  21. }
  22. })
  23. },
  24. globalData: {
  25. userInfo: null
  26. }
  27. })