Skip to content

Commit

Permalink
[ISSUE alibaba#8784] fix user reset password in the Header.js
Browse files Browse the repository at this point in the history
  • Loading branch information
onewe committed Jul 22, 2022
1 parent 3f0c91b commit cd2f7e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions console-ui/src/layouts/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Header extends React.Component {
changePassword = () => {
this.setState({
passwordResetUser: this.getUsername(),
passwordResetUserVisible: true,
});
};

Expand Down Expand Up @@ -84,7 +85,7 @@ class Header extends React.Component {
location: { pathname },
} = this.props;
const { home, docs, blog, community, enterprise, languageSwitchButton } = locale;
const { passwordResetUser = '' } = this.state;
const { passwordResetUser = '', passwordResetUserVisible = false } = this.state;
const BASE_URL = `https://nacos.io/${language.toLocaleLowerCase()}/`;
const NAV_MENU = [
{ id: 1, title: home, link: BASE_URL },
Expand Down Expand Up @@ -135,13 +136,16 @@ class Header extends React.Component {
</div>
</header>
<PasswordReset
visible={passwordResetUserVisible}
username={passwordResetUser}
onOk={user =>
passwordReset(user).then(res => {
return res;
})
}
onCancel={() => this.setState({ passwordResetUser: undefined })}
onCancel={() =>
this.setState({ passwordResetUser: undefined, passwordResetUserVisible: false })
}
/>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions console/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
<!-- 第三方css结束 -->
<link href="./css/main.css?aaa15b6be64e33808935" rel="stylesheet"></head>
<link href="./css/main.css?63e21d02ece6640bf812" rel="stylesheet"></head>

<body>
<div id="root" style="overflow:hidden"></div>
Expand All @@ -56,6 +56,6 @@
<script src="console-ui/public/js/merge.js"></script>
<script src="console-ui/public/js/loader.js"></script>
<!-- 第三方js结束 -->
<script type="text/javascript" src="./js/main.js?aaa15b6be64e33808935"></script></body>
<script type="text/javascript" src="./js/main.js?63e21d02ece6640bf812"></script></body>

</html>
2 changes: 1 addition & 1 deletion console/src/main/resources/static/js/main.js

Large diffs are not rendered by default.

0 comments on commit cd2f7e1

Please sign in to comment.