config1.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // 判断浏览器是否为IE
  2. const ua = window.navigator.userAgent
  3. const isIE = ua.indexOf('MSIE') !== -1 || ua.indexOf('Trident/') !== -1
  4. // 如果浏览器为IE,则提示用户更新浏览器
  5. if (isIE) {
  6. // alert('您的浏览器版本过低,请更新浏览器!')
  7. window.unsupportedBrowser = true
  8. document.getElementById('app').innerHTML = '<h1 style="width:960px;margin:200px auto;font-size:32px;font-weight:700;">您的浏览器版本过低,请升级浏览器以获取更好的体验!<br>推荐使用 <a href="https://www.microsoft.com/zh-cn/edge" style="color:blue">Microsoft Edge</a> 或者 <a href="https://www.google.com/chrome" style="color:blue">Google Chrome</a> 浏览器。<br>如果您使用的是双核浏览器,请切换到极速模式访问</h1>'
  9. }
  10. // 本地开发环境
  11. const local = {
  12. // web_pc: 'https://tyyx.bozedu.top/',
  13. // web_mobile: 'https://tyyxm.bozedu.top/',
  14. api: 'https://openapi.dev.bozedu.net/',
  15. oss: 'https://openapi.dev.bozedu.net/',
  16. uc: 'https://uc.dev.bozedu.net/',
  17. myxjyszptx: 'https://myxjyszptxapi.bozedu.top/',
  18. origin: window.location.origin,
  19. }
  20. // 测试服环境
  21. const development = {
  22. web_pc: 'https://myxjyszptxweb.bozedu.top/',
  23. origin: window.location.origin,
  24. api: 'https://openapi.dev.bozedu.net/',
  25. oss: 'https://openapi.dev.bozedu.net/',
  26. uc: 'https://uc.dev.bozedu.net/',
  27. myxjyszptx: 'https://myxjyszptxapi.bozedu.top/',
  28. }
  29. // // 正式服环境
  30. const production = {
  31. web_pc: 'https://myxjyszptxweb.bozedu.net/',
  32. origin: window.location.origin,
  33. api: 'https://openapi.bozedu.net/',
  34. oss: 'https://openapi.bozedu.net/',
  35. uc: 'https://uc.bozedu.net/',
  36. myxjyszptx: 'https://myxjyszptxapi.bozedu.net/',
  37. }
  38. function isWhich() {
  39. if (window.location.href.indexOf(development.web_pc) === 0) {
  40. return development
  41. } else if (window.location.href.indexOf(production.web_pc) === 0) {
  42. return production
  43. } else {
  44. return local
  45. }
  46. }
  47. window.GLOBAL_CONFIG = isWhich()