requestIP.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. export let host = 'http://zhihui-test.intra.xiaojukeji.com'
  2. // export let host = 'http://zhihui-pre.intra.xiaojukeji.com'
  3. export let requestIp = host + '/zuul'
  4. export let loginUrl = host + '/sso/login?jumpto=' + 'http://zhihui-test.intra.xiaojukeji.com' + location.pathname
  5. export let logoutUrl = host + '/sso/logout?jumpto=' + 'http://zhihui-test.intra.xiaojukeji.com' + location.pathname
  6. export let envTag = 'test'
  7. export let envUrl = 'http://10.190.5.126:8897/#/env'
  8. if (location.host.indexOf('localhost') < 0) {
  9. host = 'http://' + location.host
  10. requestIp = host + '/zuul'
  11. loginUrl = host + '/sso/login?jumpto=' + location.href
  12. logoutUrl = host + '/sso/logout?jumpto=' + location.href
  13. if (host.indexOf('zhihui-pre.intra.xiaojukeji.com') >= 0) {
  14. envTag = 'pre'
  15. } else if (host.indexOf('zhihui.xiaojukeji.com') >= 0) {
  16. envTag = 'online'
  17. envUrl = 'http://zhihui-env.intra.xiaojukeji.com/#/env'
  18. }
  19. }
  20. export function getEnv() {
  21. let env = 'test'
  22. if (location.host.indexOf('localhost') < 0) {
  23. host = 'http://' + location.host
  24. requestIp = host + '/zuul'
  25. loginUrl = host + '/sso/login?jumpto=' + location.href
  26. logoutUrl = host + '/sso/logout?jumpto=' + location.href
  27. if (host.indexOf('zhihui-pre.intra.xiaojukeji.com') >= 0) {
  28. env = 'pre'
  29. } else if (host.indexOf('zhihui.xiaojukeji.com') >= 0) {
  30. env = 'online'
  31. }
  32. }
  33. return env
  34. }
  35. export let ws = '10.78.128.20:10234'
  36. if (location.host.match(/localhost/) || location.host.match(/zhihui-test/)) {
  37. ws = '10.78.128.20:10232'
  38. } else if (location.host.match(/zhihui-pre/)) {
  39. ws = '10.78.128.20:10233'
  40. }