mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-09 15:52:55 +08:00
fix: add returnUrl for user edit page (#1152)
* feat: add redirect param Signed-off-by: magicwind <2814461814@qq.com> * Update UserEditPage.js Signed-off-by: magicwind <2814461814@qq.com> Co-authored-by: Gucheng <85475922+nomeguy@users.noreply.github.com>
This commit is contained in:
@@ -101,6 +101,11 @@ class UserEditPage extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getReturnUrl() {
|
||||||
|
const searchParams = new URLSearchParams(this.props.location.search);
|
||||||
|
return searchParams.get("returnUrl");
|
||||||
|
}
|
||||||
|
|
||||||
parseUserField(key, value) {
|
parseUserField(key, value) {
|
||||||
// if ([].includes(key)) {
|
// if ([].includes(key)) {
|
||||||
// value = Setting.myParseInt(value);
|
// value = Setting.myParseInt(value);
|
||||||
@@ -616,6 +621,13 @@ class UserEditPage extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
this.props.history.push(`/users/${this.state.user.owner}/${this.state.user.name}`);
|
this.props.history.push(`/users/${this.state.user.owner}/${this.state.user.name}`);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (willExist) {
|
||||||
|
const returnUrl = this.getReturnUrl();
|
||||||
|
if (returnUrl) {
|
||||||
|
window.location.href = returnUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Setting.showMessage("error", res.msg);
|
Setting.showMessage("error", res.msg);
|
||||||
|
Reference in New Issue
Block a user