app.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // #ifdef H5
  2. let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
  3. // #endif
  4. let openPlantGrass = '-openPlantGrass-'
  5. // 网络接口修改此字符 小程序域名要求https
  6. // let httpApi = 'https://www.sxczdz.com'
  7. // #ifdef MP-WEIXIN
  8. let httpApi = 'https://ygs.hqgjsmc.com' //测试
  9. // #endif
  10. // #ifndef MP-WEIXIN
  11. let httpApi = 'http://ygs.hqgjsmc.com' //测试
  12. // #endif
  13. // let httpApi = 'https://mer1.crmeb.net' //生产
  14. // 聊天接口修改此字符 小程序聊天要求wss 例如:wss://mer.crmeb.net
  15. // let wsApi = 'ws://127.0.0.1:8324'
  16. let wsApi = 'wss://mer1.crmeb.net'
  17. module.exports = {
  18. // 请求域名 格式: https://您的域名
  19. // #ifdef MP || APP-PLUS
  20. // HTTP_REQUEST_URL: httpApi,
  21. HTTP_REQUEST_URL: httpApi,
  22. VUE_APP_WS_URL: `${wsApi}?type=user`,
  23. // #endif
  24. // #ifdef H5
  25. //H5接口是浏览器地址
  26. HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host,
  27. // 聊天长连接地址
  28. VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL,
  29. // #endif
  30. openPlantGrass: openPlantGrass,
  31. HEADER: {
  32. 'content-type': 'application/json',
  33. //#ifdef H5
  34. 'Form-type': navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1 ? 'wechat' : 'h5',
  35. //#endif
  36. //#ifdef MP
  37. 'Form-type': 'routine',
  38. //#endif
  39. //#ifdef APP-PLUS
  40. 'Form-type': 'app',
  41. //#endif
  42. },
  43. // 回话密钥名称 请勿修改此配置
  44. TOKENNAME: 'X-Token',
  45. // 缓存时间 0 永久
  46. EXPIRE: 0,
  47. };