🐞 fix: 优化login-redirect;添加redirectToAuth接口

This commit is contained in:
LokerL 2024-11-24 18:37:24 +08:00
parent 94d56d71be
commit 1b5cca52ca
2 changed files with 10 additions and 2 deletions

View File

@ -66,3 +66,11 @@ export function getAccountName(data) {
params: data params: data
}) })
} }
export function redirectToAuth(data) {
return request({
url: '/redirectToAuth',
method: 'get',
params: data
})
}

View File

@ -9,7 +9,7 @@ export default {
return { return {
authorizeUrl: "https://iam.sd-port.com:18010/idp/oauth2/authorize", authorizeUrl: "https://iam.sd-port.com:18010/idp/oauth2/authorize",
clientId: "hfxyjwzxjc", 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() { created() {
@ -17,7 +17,7 @@ export default {
}, },
methods: { methods: {
loginRedirect() { 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}`;
}, },
} }
}; };