app.js 833 B

1234567891011121314151617181920212223242526272829303132
  1. //app.js
  2. App({
  3. onLaunch: function () {
  4. let test = wx.getAccountInfoSync().miniProgram.envVersion;
  5. if (test !== 'release') { // 非正式环境
  6. this.baseUrl = "https://bigdata.smcic.net"
  7. }
  8. let _this = this;
  9. wx.request({
  10. url: this.baseUrl + '/sys-config',
  11. success: function (res) {
  12. if (res.statusCode !== 200) return wx.showToast({
  13. title: '请重启小程序',
  14. icon: "error"
  15. })
  16. let data = res.data || [];
  17. for (let i = 0; i < data.length; i++) {
  18. const d = data[i];
  19. _this.introduce[d.name] = d.value;
  20. }
  21. },
  22. fail: function (err) {
  23. wx.showToast({
  24. title: '请重启小程序',
  25. icon: "error"
  26. })
  27. },
  28. })
  29. },
  30. baseUrl: "https://bigdata.smcic.net",
  31. introduce: {}
  32. })