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}`; }, } };