Commit 8924f3c3 authored by elevensky's avatar elevensky Committed by ddcat1115

fix user account in register-result (#695)

* fix user account in register-result

* fix up

* fix account name undefined

* location field state
parent 2d83ca7f
...@@ -35,8 +35,14 @@ export default class Register extends Component { ...@@ -35,8 +35,14 @@ export default class Register extends Component {
}; };
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const account = this.props.form.getFieldValue('mail');
if (nextProps.register.status === 'ok') { if (nextProps.register.status === 'ok') {
this.props.dispatch(routerRedux.push('/user/register-result')); this.props.dispatch(routerRedux.push({
pathname: '/user/register-result',
state: {
account,
},
}));
} }
} }
......
...@@ -4,8 +4,6 @@ import { Link } from 'dva/router'; ...@@ -4,8 +4,6 @@ import { Link } from 'dva/router';
import Result from '../../components/Result'; import Result from '../../components/Result';
import styles from './RegisterResult.less'; import styles from './RegisterResult.less';
const title = <div className={styles.title}>你的账户AntDesign@example.com 注册成功</div>;
const actions = ( const actions = (
<div className={styles.actions}> <div className={styles.actions}>
<a href=""><Button size="large" type="primary">查看邮箱</Button></a> <a href=""><Button size="large" type="primary">查看邮箱</Button></a>
...@@ -13,11 +11,11 @@ const actions = ( ...@@ -13,11 +11,11 @@ const actions = (
</div> </div>
); );
export default () => ( export default ({ location }) => (
<Result <Result
className={styles.registerResult} className={styles.registerResult}
type="success" type="success"
title={title} title={<div className={styles.title}>你的账户{location.state && location.state.account} 注册成功</div>}
description="激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。" description="激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。"
actions={actions} actions={actions}
style={{ marginTop: 56 }} style={{ marginTop: 56 }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment