util.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const globalData = {
  2. publicUrl: 'https://sqdx.windd.cn',
  3. publicUrl2: 'https://sqdx.windd.cn',
  4. publicUrl3: 'https://sqdx.windd.cn',
  5. publicSocketUrl: 'wss://sqdx.windd.cn'
  6. };
  7. // const app = getApp();
  8. // var filters = {
  9. // getSessionKey: function () {
  10. // var sessionKey = "";
  11. // var _this = this;
  12. // wx.checkSession({
  13. // success: () => {
  14. // sessionKey = wx.getStorageSync('sessionKey');
  15. // return sessionKey
  16. // },
  17. // fail() {
  18. // console.log("我没有缓存并去登录请求")
  19. // wx.login({
  20. // success(res) {
  21. // console.log(res);
  22. // var code = res.code
  23. // wx.request({
  24. // url: app.globalData.publicUrl2 + '/wx/user/wx7e7a46e129d6cd0f/login',
  25. // method: "get",
  26. // data: {
  27. // code
  28. // },
  29. // success: function (res) {
  30. // sessionKey = res.data.sessionKey;
  31. // wx.setStorageSync('sessionKey', res.data.sessionKey);
  32. // return sessionKey;
  33. // }
  34. // })
  35. // }
  36. // })
  37. // }
  38. // })
  39. // }
  40. // }
  41. module.exports = {
  42. globalData: globalData
  43. }