config-local.js 888 B

1234567891011121314151617181920212223242526272829303132333435
  1. // 本地开发环境
  2. const local = {
  3. oss: 'http://10.234.7.185:8090',
  4. api: 'http://10.234.7.185:8090/',
  5. login: 'http://10.234.7.185:8000/home/login.html',
  6. origin: window.location.origin,
  7. }
  8. // 测试服环境
  9. const development = {
  10. oss: 'http://10.234.7.185:8090',
  11. api: 'http://10.234.7.185:8090/',
  12. login: 'http://10.234.7.185:8000/home/login.html',
  13. origin: window.location.origin + '/manage/',
  14. }
  15. // 正式服环境
  16. const production = {
  17. oss: 'http://10.234.7.185:8090',
  18. api: 'http://10.234.7.185:8090/',
  19. login: 'http://10.234.7.185:8000/home/login.html',
  20. origin: window.location.origin + '/manage/',
  21. }
  22. function isWhich() {
  23. if (window.location.host.includes('localhost')) {
  24. return local
  25. } else if (window.location.host.includes('dev')) {
  26. return development
  27. } else {
  28. return production
  29. }
  30. }
  31. window.globalVariables = isWhich()