requestIP.js 1.7 KB

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