From 35ae29ca494c65d34daf0e4ca004adc63c304d92 Mon Sep 17 00:00:00 2001 From: xd Date: Thu, 16 May 2024 21:16:14 +0800 Subject: [PATCH] 123 --- ruoyi-ui/src/layout/components/Navbar.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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'); }) } })