config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. let env = require('../env.js')
  2. const {PLATFORM} = env
  3. // #ifdef H5
  4. // const url_all = { 'DEV': '/dev-api', 'BUILD': '' } // h5配置
  5. const url_all = { 'DEV': 'https://90.5000v.com', 'BUILD': '' } // h5配置
  6. let protocol = window.location.protocol;
  7. if (protocol === "https:") {
  8. protocol = "wss:";
  9. } else {
  10. protocol = "ws:";
  11. }
  12. const ws_url_all = { 'DEV': `/dev-api`, 'BUILD': `${protocol}//${window.location.host}` }
  13. // #endif
  14. // #ifndef H5
  15. let url_all,ws_url_all
  16. if (PLATFORM === "enterprises") {
  17. // 企事业
  18. url_all = { 'DEV': 'http://xchw.bds199.com', 'BUILD': 'http://xchw.bds199.com' } // 非h5配置
  19. ws_url_all = { 'DEV': 'http://xchw.bds199.com', 'BUILD': 'http://xchw.bds199.com' } // 非h5配置
  20. }else if (PLATFORM === "sanitation") {
  21. url_all = { 'DEV': 'http://xchw.bds199.com', 'BUILD': 'http://xchw.bds199.com' } // 非h5配置
  22. ws_url_all = { 'DEV': 'http://xchw.bds199.com', 'BUILD': 'http://xchw.bds199.com' } // 非h5配置
  23. }
  24. // #endif
  25. let server_url = process.env.NODE_ENV === 'development' ? url_all['DEV'] : url_all['BUILD']
  26. let ws_server_url = process.env.NODE_ENV === 'development' ? ws_url_all['DEV'] : ws_url_all['BUILD']
  27. export {
  28. server_url,
  29. ws_server_url
  30. };