config.js 1.3 KB

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