You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by li...@apache.org on 2023/06/10 02:30:56 UTC

[shenyu-dashboard] branch master updated: bugfix can update state on unmounted component, refactor change default password ui (#285)

This is an automated email from the ASF dual-hosted git repository.

likeguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new ac474fa9 bugfix can update state on unmounted component, refactor change default password ui (#285)
ac474fa9 is described below

commit ac474fa9d09fbc1504436fe801e9c9f68d059eaf
Author: tomsun28 <to...@outlook.com>
AuthorDate: Sat Jun 10 10:30:51 2023 +0800

    bugfix can update state on unmounted component, refactor change default password ui (#285)
---
 src/components/GlobalHeader/index.js | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/components/GlobalHeader/index.js b/src/components/GlobalHeader/index.js
index b6cf7884..42d355fb 100644
--- a/src/components/GlobalHeader/index.js
+++ b/src/components/GlobalHeader/index.js
@@ -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") {
@@ -145,6 +149,7 @@ class GlobalHeader extends PureComponent {
           </div>
         </div>
         <Modal
+          width="35%"
           title={getIntlContent("SHENYU.GLOBALHEADER.CHANGE.PASSWORD")}
           visible={visible}
           forceRender
@@ -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