feat: certEditPage will be redirected to 404 when name is changed (#3154)

This commit is contained in:
DacongDA 2024-08-30 23:04:50 +08:00 committed by GitHub
parent 45dd4cc344
commit ec98785172
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -288,14 +288,14 @@ class CertEditPage extends React.Component {
Setting.showMessage("success", i18next.t("general:Successfully saved")); Setting.showMessage("success", i18next.t("general:Successfully saved"));
this.setState({ this.setState({
certName: this.state.cert.name, certName: this.state.cert.name,
}); }, () => {
if (exitAfterSave) { if (exitAfterSave) {
this.props.history.push("/certs"); this.props.history.push("/certs");
} else { } else {
this.props.history.push(`/certs/${this.state.cert.owner}/${this.state.cert.name}`); this.props.history.push(`/certs/${this.state.cert.owner}/${this.state.cert.name}`);
this.getCert(); this.getCert();
} }
});
} else { } else {
Setting.showMessage("error", `${i18next.t("general:Failed to save")}: ${res.msg}`); Setting.showMessage("error", `${i18next.t("general:Failed to save")}: ${res.msg}`);
this.updateCertField("name", this.state.certName); this.updateCertField("name", this.state.certName);