app.js 1.4 KB

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