feat: callback will jump to blank page when from param start with "http" (#2778)

This commit is contained in:
DacongDA
2024-03-06 01:07:52 +08:00
committed by GitHub
parent fbdd5a926d
commit 4123d47174
2 changed files with 10 additions and 1 deletions

View File

@ -707,6 +707,15 @@ export function goToLinkSoft(ths, link) {
ths.props.history.push(link); ths.props.history.push(link);
} }
export function goToLinkSoftOrJumpSelf(ths, link) {
if (link.startsWith("http")) {
goToLink(link);
return;
}
ths.props.history.push(link);
}
export function showMessage(type, text) { export function showMessage(type, text) {
if (type === "success") { if (type === "success") {
message.success(text); message.success(text);

View File

@ -172,7 +172,7 @@ class AuthCallback extends React.Component {
Setting.goToLink(`${oAuthParams.redirectUri}${concatChar}${responseType}=${token}&state=${oAuthParams.state}&token_type=bearer`); Setting.goToLink(`${oAuthParams.redirectUri}${concatChar}${responseType}=${token}&state=${oAuthParams.state}&token_type=bearer`);
} else if (responseType === "link") { } else if (responseType === "link") {
const from = innerParams.get("from"); const from = innerParams.get("from");
Setting.goToLinkSoft(this, from); Setting.goToLinkSoftOrJumpSelf(this, from);
} else if (responseType === "saml") { } else if (responseType === "saml") {
if (res.data2.method === "POST") { if (res.data2.method === "POST") {
this.setState({ this.setState({