requestIP.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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://zhihui-test.intra.xiaojukeji.com/zhihui_env/'
  8. export let toolsUrl = 'http://zhihui-test.intra.xiaojukeji.com/tools/'
  9. if (location.host.indexOf('localhost') < 0) {
  10. host = 'http://' + location.host
  11. requestIp = host + '/zuul'
  12. loginUrl = host + '/sso/login?jumpto=' + location.href
  13. logoutUrl = host + '/sso/logout?jumpto=' + location.href
  14. if (host.indexOf('zhihui-pre.intra.xiaojukeji.com') >= 0) {
  15. envTag = 'pre'
  16. envUrl = 'http://zhihui-pre.intra.xiaojukeji.com/zhihui_env/'
  17. toolsUrl = 'http://zhihui-pre.intra.xiaojukeji.com/tools/'
  18. } else if (host.indexOf('zhihui.xiaojukeji.com') >= 0) {
  19. envTag = 'online'
  20. envUrl = 'http://zhihui.xiaojukeji.com/zhihui_env/'
  21. toolsUrl = 'http://zhihui.xiaojukeji.com/tools/'
  22. }
  23. }
  24. export function getEnv() {
  25. let env = 'test'
  26. if (location.host.indexOf('localhost') < 0) {
  27. host = 'http://' + location.host
  28. requestIp = host + '/zuul'
  29. loginUrl = host + '/sso/login?jumpto=' + location.href
  30. logoutUrl = host + '/sso/logout?jumpto=' + location.href
  31. if (host.indexOf('zhihui-pre.intra.xiaojukeji.com') >= 0) {
  32. env = 'pre'
  33. } else if (host.indexOf('zhihui.xiaojukeji.com') >= 0) {
  34. env = 'online'
  35. }
  36. }
  37. return env
  38. }
  39. export let ws = '10.78.128.20:10234'
  40. if (location.host.match(/localhost/) || location.host.match(/zhihui-test/)) {
  41. ws = '10.78.128.20:10232'
  42. } else if (location.host.match(/zhihui-pre/)) {
  43. ws = '10.78.128.20:10233'
  44. }