Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix can update state on unmounted component, refactor change default password ui #285

Merged
merged 1 commit into from
Jun 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/components/GlobalHeader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ class GlobalHeader extends PureComponent {
if (res && res.code !== 200) {
this.setState({ visible: true ,display :"block"})
}
});
})
}
}

componentWillUnmount() {
this.setState = () => false;
}

handleLocalesValueChange = value => {
const { changeLocalName } = this.props;
if (value.key === "0") {
Expand Down Expand Up @@ -145,6 +149,7 @@ class GlobalHeader extends PureComponent {
</div>
</div>
<Modal
width="35%"
title={getIntlContent("SHENYU.GLOBALHEADER.CHANGE.PASSWORD")}
visible={visible}
forceRender
Expand Down Expand Up @@ -176,11 +181,11 @@ class GlobalHeader extends PureComponent {
});
}}
>
<div className={styles.warning} style={{display: this.state.display}}>
<div className={styles.warning} style={{display: this.state.display, textAlign: 'center', marginBottom: 16}}>
{getIntlContent("SHENYU.SYSTEM.USER.CHANGEPASSWORD")}
</div>


<Form labelCol={{ span: 8 }} wrapperCol={{ span: 14 }}>
<Form.Item
required
Expand Down