config.js 831 B

123456789101112131415161718192021222324252627282930313233343536
  1. // 本地开发环境
  2. const local = {
  3. api: ' https://openapi.dev.bozedu.net/',
  4. oss: ' https://openapi.dev.bozedu.net/',
  5. uc: 'https://uc.dev.bozedu.net/',
  6. }
  7. // 测试服环境
  8. const development = {
  9. web_pc: 'https://dyawdev.bozedu.top/',
  10. api: ' https://openapi.dev.bozedu.net/',
  11. oss: ' https://openapi.dev.bozedu.net/',
  12. uc: 'https://uc.dev.bozedu.net/',
  13. }
  14. // // 正式服环境
  15. const production = {
  16. web_pc: 'https://dyaw.bozedu.net/',
  17. api: ' https://openapi.bozedu.net/',
  18. oss: ' https://openapi.bozedu.net/',
  19. uc:'https://uc.bozedu.net/',
  20. }
  21. function isWhich() {
  22. if (window.location.href.startsWith(development.web_pc)) {
  23. return development
  24. } else if (window.location.href.startsWith(production.web_pc)) {
  25. return production
  26. } else {
  27. return production
  28. }
  29. }
  30. window.GLOBAL_CONFIG = isWhich()