config.js 1.4 KB

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