config.js 968 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // 本地开发环境
  2. const local = {
  3. web_pc: 'http://tyyx.bozedu.top/',
  4. web_mobile: 'http://tyyxm.bozedu.top/',
  5. api: 'http://tyyx_openapi.bozedu.top/',
  6. oss: 'http://tyyx_openapi.bozedu.top/',
  7. origin: window.location.origin,
  8. }
  9. // 测试服环境
  10. const development = {
  11. web_pc: 'https://tyyx.bozedu.top/',
  12. web_mobile: 'https://tyyxm.bozedu.top/',
  13. origin: window.location.origin,
  14. api: 'https://tyyxopenapi.bozedu.top/',
  15. oss: 'https://tyyxopenapi.bozedu.top/'
  16. }
  17. // 正式服环境
  18. const production = {
  19. web_pc: 'https://tyyx.bozedu.top/',
  20. web_mobile: 'https://tyyxm.bozedu.top/',
  21. origin: window.location.origin,
  22. api: 'https://tyyxopenapi.bozedu.top/',
  23. oss: 'https://tyyxopenapi.bozedu.top/'
  24. }
  25. function isWhich() {
  26. if (window.location.host.includes('tyyx.bozedu.top')) {
  27. return development
  28. } else if (window.location.protocol === 'https:') {
  29. return production
  30. } else {
  31. return local
  32. }
  33. }
  34. window.GLOBAL_CONFIG = isWhich()