config.js 1.4 KB

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