From 8924f3c3a8f234c86faa5e99337fc7df1afa912e Mon Sep 17 00:00:00 2001 From: elevensky <346800989@qq.com> Date: Thu, 18 Jan 2018 00:47:26 +0800 Subject: [PATCH] fix user account in register-result (#695) * fix user account in register-result * fix up * fix account name undefined * location field state --- src/routes/User/Register.js | 8 +++++++- src/routes/User/RegisterResult.js | 6 ++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/routes/User/Register.js b/src/routes/User/Register.js index 77b36505..3521ea77 100644 --- a/src/routes/User/Register.js +++ b/src/routes/User/Register.js @@ -35,8 +35,14 @@ export default class Register extends Component { }; componentWillReceiveProps(nextProps) { + const account = this.props.form.getFieldValue('mail'); if (nextProps.register.status === 'ok') { - this.props.dispatch(routerRedux.push('/user/register-result')); + this.props.dispatch(routerRedux.push({ + pathname: '/user/register-result', + state: { + account, + }, + })); } } diff --git a/src/routes/User/RegisterResult.js b/src/routes/User/RegisterResult.js index e86cffbd..22c83080 100644 --- a/src/routes/User/RegisterResult.js +++ b/src/routes/User/RegisterResult.js @@ -4,8 +4,6 @@ import { Link } from 'dva/router'; import Result from '../../components/Result'; import styles from './RegisterResult.less'; -const title =
你的账户:AntDesign@example.com 注册成功
; - const actions = (
@@ -13,11 +11,11 @@ const actions = (
); -export default () => ( +export default ({ location }) => ( 你的账户:{location.state && location.state.account} 注册成功} description="激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。" actions={actions} style={{ marginTop: 56 }} -- GitLab