config.js 1.1 KB

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