app.js 697 B

1234567891011121314151617181920212223242526272829303132333435
  1. // app.js
  2. const login = require("./utils/login.js");
  3. const request = require("./utils/request.js");
  4. App({
  5. onLaunch() {
  6. // 自动登录
  7. login.autoLogin()
  8. this.getDistrictData()
  9. },
  10. getDistrictData() {
  11. let that = this;
  12. request.getData(
  13. 'app/district/list',{},
  14. res => {
  15. wx.setStorageSync('districtData', res.data.data)
  16. }
  17. )
  18. },
  19. globalData: {
  20. userInfo: null,
  21. content: '',
  22. imgList: [],
  23. selectedTagList: [],
  24. env: {
  25. uploadImageUrl: 'https://toktok-beer.oss-cn-shenzhen.aliyuncs.com/',
  26. AccessKeySecret: '',
  27. OSSAccessKeyId: '',
  28. securityToken: '',
  29. timeout: 87600
  30. },
  31. adress_select: {}
  32. }
  33. })