diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index fc81165..760205a 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -140,7 +140,12 @@ export default { //获取 OA登录-token getSwitchAccountToken(account).then(response => { this.switchAccountOpen = false; - window.open('http://localhost:3335/ssoLogin?loginid=' + account + '&token=' + response.token, '_self'); + + // 当前浏览器Location对象 + const nowLocation = window.location; + // host => ip:port + const host = nowLocation.host; + window.open('http://'+host+'/ssoLogin?loginid=' + account + '&token=' + response.token, '_self'); }) } })