config.js 652 B

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