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