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. web_pc: 'https://yzy.dev.bozedu.net/',
  6. qqyxt: 'https://qqyxt.dev.bozedu.net/',
  7. yzy: 'https://yzy.dev.bozedu.net/',
  8. api:'https://openapi.dev.bozedu.net/',
  9. uc: 'https://uc.dev.bozedu.net/',
  10. origin: window.location.origin,
  11. }
  12. // 测试服环境
  13. const development = {
  14. web_pc: 'https://yzy.dev.bozedu.net/',
  15. origin: window.location.origin,
  16. qqyxt: 'https://qqyxt.dev.bozedu.net/',
  17. yzy: 'https://yzy.dev.bozedu.net/',
  18. api:'https://openapi.dev.bozedu.net/',
  19. uc: 'https://uc.dev.bozedu.net/',
  20. }
  21. // // 正式服环境
  22. const production = {
  23. web_pc: 'https://yzy.bozedu.net/',
  24. origin: window.location.origin,
  25. qqyxt: 'https://qqyxt.bozedu.net/',
  26. yzy: 'https://yzy.bozedu.net/',
  27. api:'https://openapi.bozedu.net/',
  28. uc: 'https://uc.bozedu.net/',
  29. }
  30. function isWhich() {
  31. if (window.location.href.startsWith(development.web_pc)) {
  32. return development
  33. } else if (window.location.href.startsWith(production.web_pc)) {
  34. return production
  35. } else {
  36. return local
  37. }
  38. }
  39. // window.GLOBAL_CONFIG = isWhich()
  40. window.GLOBAL_CONFIG = isWhich()