config.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. pend: 'https://tyyxopenapi.txhlwxx.com/',
  10. }
  11. // 测试服环境
  12. const development = {
  13. web_pc: 'https://tyyx.bozedu.top/',
  14. web_mobile: 'https://tyyxm.bozedu.top/',
  15. origin: window.location.origin,
  16. api: 'https://tyyxopenapi.bozedu.top/',
  17. oss: 'https://tyyxopenapi.bozedu.top/',
  18. pend: 'https://tyyxopenapi.txhlwxx.com/',
  19. }
  20. // 演示服环境
  21. const demo = {
  22. web_pc: 'https://tyyx.bozedu.net/',
  23. web_mobile: 'https://tyyxm.bozedu.net/',
  24. origin: window.location.origin,
  25. api: 'https://tyyxopenapi.bozedu.net/',
  26. oss: 'https://tyyxopenapi.bozedu.net/',
  27. pend: 'https://tyyxopenapi.txhlwxx.com/',
  28. }
  29. // 正式服环境
  30. const production = {
  31. web_pc: 'https://tyyx.txhlwxx.com/',
  32. web_mobile: 'https://tyyxm.txhlwxx.com/',
  33. origin: window.location.origin,
  34. api: 'https://tyyxopenapi.txhlwxx.com/',
  35. oss: 'https://tyyxopenapi.txhlwxx.com/',
  36. pend: 'https://tyyxopenapi.txhlwxx.com/',
  37. }
  38. function isWhich() {
  39. if (window.location.host.includes('tyyx.bozedu.top')) {
  40. return development
  41. } else if(window.location.host.includes('tyyx.bozedu.net')) {
  42. return demo
  43. } else if(window.location.host.includes('tyyx.txhlwxx.com')) {
  44. return production
  45. } else {
  46. // return local;
  47. return production
  48. }
  49. }
  50. window.GLOBAL_CONFIG = isWhich()