config.js 530 B

12345678910111213141516171819202122232425262728
  1. let api = "https://passport.lrlz.com/mobile/index.php"
  2. function getReq(data, callback, fail) {
  3. let options = {
  4. client_type: 'ios'
  5. }
  6. data = Object.assign({}, options, data);
  7. let session_id = wx.getStorageSync('session_id');
  8. return wx.request({
  9. url: api,
  10. data,
  11. header: {
  12. 'content-type': 'application/json', // 默认值
  13. 'Cookie': 'MPHPSESSID=' + session_id
  14. },
  15. success(res) {
  16. callback(res.data)
  17. },
  18. fail() {
  19. fail && fail()
  20. }
  21. })
  22. }
  23. module.exports = {
  24. getReq
  25. }