config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. origin: window.location.origin,
  16. api: 'https://aimoocapi.bozedu.top',
  17. oss: 'https://aimoocapi.bozedu.top',
  18. uc: 'https://uc.dev.bozedu.net/',
  19. }
  20. // // 正式服环境
  21. const production = {
  22. web_pc: 'https://txwx.txhlwxx.com/',
  23. origin: window.location.origin,
  24. api: 'https://txwxopenapi.txhlwxx.com/',
  25. oss: 'https://txwxopenapi.txhlwxx.com/',
  26. uc: 'https://uc.bozedu.net/',
  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()