config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // 本地开发环境
  2. const local = {
  3. // web_pc: 'https://tyyx.bozedu.top/',
  4. // web_mobile: 'https://tyyxm.bozedu.top/',
  5. api: 'https://txwxopenapi.bozedu.top/',
  6. oss: 'https://txwxopenapi.bozedu.top/',
  7. uc: 'https://uc.dev.bozedu.net/',
  8. origin: window.location.origin,
  9. tyyx: 'https://tyyx.bozedu.top/#/home'
  10. }
  11. // 测试服环境
  12. const development = {
  13. web_pc: 'https://txwx.bozedu.top/',
  14. origin: window.location.origin,
  15. api: 'https://txwxopenapi.bozedu.top/',
  16. oss: 'https://txwxopenapi.bozedu.top/',
  17. uc: 'https://uc.dev.bozedu.net/',
  18. tyyx: 'https://tyyx.bozedu.top/#/home'
  19. }
  20. // // 正式服环境
  21. const production = {
  22. web_pc: 'https://txwx.txhlwxx.com/',
  23. origin: window.location.origin,
  24. api: 'https://txwxopenapi.txhlwxx.com/',
  25. oss: 'https://txwxopenapi.txhlwxx.com/',
  26. uc: 'https://uc.bozedu.net/',
  27. tyyx:'https://tyyx.txhlwxx.com/#/home'
  28. }
  29. function isWhich() {
  30. if (window.location.href.startsWith(development.web_pc)) {
  31. return development
  32. } else if (window.location.href.startsWith(production.web_pc)) {
  33. return production
  34. } else {
  35. return local
  36. }
  37. }
  38. window.GLOBAL_CONFIG = isWhich()