From 1b5cca52caa7177f258b0dcfab5b24a16b223de2 Mon Sep 17 00:00:00 2001 From: LokerL Date: Sun, 24 Nov 2024 18:37:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BC=98=E5=8C=96login-r?= =?UTF-8?q?edirect=EF=BC=9B=E6=B7=BB=E5=8A=A0redirectToAuth=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/login.js | 8 ++++++++ ruoyi-ui/src/views/login-redirect.vue | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/api/login.js b/ruoyi-ui/src/api/login.js index 85e9b82..af2a88c 100644 --- a/ruoyi-ui/src/api/login.js +++ b/ruoyi-ui/src/api/login.js @@ -66,3 +66,11 @@ export function getAccountName(data) { params: data }) } + +export function redirectToAuth(data) { + return request({ + url: '/redirectToAuth', + method: 'get', + params: data + }) +} diff --git a/ruoyi-ui/src/views/login-redirect.vue b/ruoyi-ui/src/views/login-redirect.vue index efd50e4..5bf769c 100644 --- a/ruoyi-ui/src/views/login-redirect.vue +++ b/ruoyi-ui/src/views/login-redirect.vue @@ -9,7 +9,7 @@ export default { return { authorizeUrl: "https://iam.sd-port.com:18010/idp/oauth2/authorize", clientId: "hfxyjwzxjc", - redirectUri: "http://10.167.96.13/prod-api/redirectToAuth&response_type=code&state=123", + redirectUri: `${window.location.origin}/prod-api/redirectToAuth&response_type=code&state=123`, }; }, created() { @@ -17,7 +17,7 @@ export default { }, methods: { loginRedirect() { - window.location = `${this.authorizeUrl}?client_id=${this.clientId}&redirect_uri=${this.redirectUri}` + window.location = `${this.authorizeUrl}?client_id=${this.clientId}&redirect_uri=${this.redirectUri}`; }, } };