config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // 本地开发环境
  2. const local = {
  3. web_pc: 'https://tyyx.bozedu.top/',
  4. web_mobile: 'https://tyyxm.bozedu.top/',
  5. api: 'https://tyyxopenapi.bozedu.top/',
  6. oss: 'https://tyyxopenapi.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 demo = {
  19. web_pc: 'https://tyyx.bozedu.net/',
  20. web_mobile: 'https://tyyxm.bozedu.net/',
  21. origin: window.location.origin,
  22. api: 'https://tyyxopenapi.bozedu.net/',
  23. oss: 'https://tyyxopenapi.bozedu.net/'
  24. }
  25. // 正式服环境
  26. const production = {
  27. web_pc: 'https://tyyx.txhlwxx.com/',
  28. web_mobile: 'https://tyyxm.txhlwxx.com/',
  29. origin: window.location.origin,
  30. api: 'https://tyyxopenapi.txhlwxx.com/',
  31. oss: 'https://tyyxopenapi.txhlwxx.com/'
  32. }
  33. function isWhich() {
  34. if (window.location.host.includes('tyyx.bozedu.top')) {
  35. return development
  36. } else if (window.location.host.includes('tyyx.bozedu.net')) {
  37. return demo
  38. } else if (window.location.host.includes('tyyxm.txhlwxx.com')) {
  39. return production
  40. } else {
  41. return local
  42. }
  43. }
  44. window.GLOBAL_CONFIG = isWhich()