提交 871b706342f4641efef77998e44466e45074988a

作者 陈帅
1 个父辈 df49b20d

prettier all code

正在显示 33 个修改的文件 包含 248 行增加294 行删除
... ... @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => (
18 18 return item.title;
19 19 }}
20 20 />
21   - {children ? (
22   - <div className={styles.content}>
23   - {children}
24   - </div>
25   - ) : null}
  21 + {children ? <div className={styles.content}>{children}</div> : null}
26 22 </div>
27 23 );
28 24
... ...
... ... @@ -2,7 +2,7 @@ export default {
2 2 'app.forms.basic.title': 'Basic form',
3 3 'app.forms.basic.description':
4 4 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.',
5   -
  5 +
6 6 'validation.email.required': 'Por favor insira seu email!',
7 7 'validation.email.wrong-format': 'O email está errado!',
8 8 'validation.userName.required': 'Por favor insira nome de usuário!',
... ...
... ... @@ -20,7 +20,7 @@ export default {
20 20 'validation.date.required': '请选择起止日期',
21 21 'validation.goal.required': '请输入目标描述',
22 22 'validation.standard.required': '请输入衡量标准',
23   -
  23 +
24 24 'form.get-captcha': '获取验证码',
25 25 'form.captcha.second': '秒',
26 26 'form.optional': '(选填)',
... ...
... ... @@ -2,7 +2,7 @@ export default {
2 2 'app.forms.basic.title': '基礎表單',
3 3 'app.forms.basic.description':
4 4 '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。',
5   -
  5 +
6 6 'validation.email.required': '請輸入郵箱地址!',
7 7 'validation.email.wrong-format': '郵箱地址格式錯誤!',
8 8 'validation.userName.required': '請輸入賬戶!',
... ...
... ... @@ -5,8 +5,7 @@ import { fakeSubmitForm } from './service';
5 5 export default {
6 6 namespace: 'form',
7 7
8   - state: {
9   - },
  8 + state: {},
10 9
11 10 effects: {
12 11 *submitAdvancedForm({ payload }, { call }) {
... ...
... ... @@ -26,11 +26,7 @@ const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...r
26 26 />
27 27 )}
28 28 </MenuContext.Consumer>
29   - {children ? (
30   - <div className={styles.content}>
31   - {children}
32   - </div>
33   - ) : null}
  29 + {children ? <div className={styles.content}>{children}</div> : null}
34 30 </div>
35 31 );
36 32
... ...
... ... @@ -22,7 +22,6 @@ import { DescriptionList } from 'ant-design-pro';
22 22 import PageHeaderWrapper from './components/PageHeaderWrapper';
23 23 import styles from './style.less';
24 24
25   -
26 25 const { Step } = Steps;
27 26 const { Description } = DescriptionList;
28 27 const ButtonGroup = Button.Group;
... ...
... ... @@ -63,7 +63,7 @@ const cachedSave = (response, hashcode) => {
63 63 * @param {object} [option] The options we want to pass to "fetch"
64 64 * @return {object} An object containing either "data" or "err"
65 65 */
66   -export default function (url, option) {
  66 +export default function(url, option) {
67 67 const options = {
68 68 expirys: isAntdPro(),
69 69 ...option,
... ...
... ... @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => (
18 18 return item.title;
19 19 }}
20 20 />
21   - {children ? (
22   - <div className={styles.content}>
23   - {children}
24   - </div>
25   - ) : null}
  21 + {children ? <div className={styles.content}>{children}</div> : null}
26 22 </div>
27 23 );
28 24
... ...
... ... @@ -2,7 +2,7 @@ export default {
2 2 'app.forms.basic.title': 'Basic form',
3 3 'app.forms.basic.description':
4 4 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.',
5   -
  5 +
6 6 'validation.email.required': 'Por favor insira seu email!',
7 7 'validation.email.wrong-format': 'O email está errado!',
8 8 'validation.userName.required': 'Por favor insira nome de usuário!',
... ...
... ... @@ -20,7 +20,7 @@ export default {
20 20 'validation.date.required': '请选择起止日期',
21 21 'validation.goal.required': '请输入目标描述',
22 22 'validation.standard.required': '请输入衡量标准',
23   -
  23 +
24 24 'form.get-captcha': '获取验证码',
25 25 'form.captcha.second': '秒',
26 26 'form.optional': '(选填)',
... ...
... ... @@ -2,7 +2,7 @@ export default {
2 2 'app.forms.basic.title': '基礎表單',
3 3 'app.forms.basic.description':
4 4 '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。',
5   -
  5 +
6 6 'validation.email.required': '請輸入郵箱地址!',
7 7 'validation.email.wrong-format': '郵箱地址格式錯誤!',
8 8 'validation.userName.required': '請輸入賬戶!',
... ...
... ... @@ -5,8 +5,7 @@ import { fakeSubmitForm } from './service';
5 5 export default {
6 6 namespace: 'form',
7 7
8   - state: {
9   - },
  8 + state: {},
10 9
11 10 effects: {
12 11 *submitRegularForm({ payload }, { call }) {
... ...
... ... @@ -26,11 +26,7 @@ const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...r
26 26 />
27 27 )}
28 28 </MenuContext.Consumer>
29   - {children ? (
30   - <div className={styles.content}>
31   - {children}
32   - </div>
33   - ) : null}
  29 + {children ? <div className={styles.content}>{children}</div> : null}
34 30 </div>
35 31 );
36 32
... ...
... ... @@ -63,7 +63,7 @@ const cachedSave = (response, hashcode) => {
63 63 * @param {object} [option] The options we want to pass to "fetch"
64 64 * @return {object} An object containing either "data" or "err"
65 65 */
66   -export default function (url, option) {
  66 +export default function(url, option) {
67 67 const options = {
68 68 expirys: isAntdPro(),
69 69 ...option,
... ...
... ... @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => (
18 18 return item.title;
19 19 }}
20 20 />
21   - {children ? (
22   - <div className={styles.content}>
23   - {children}
24   - </div>
25   - ) : null}
  21 + {children ? <div className={styles.content}>{children}</div> : null}
26 22 </div>
27 23 );
28 24
... ...
... ... @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => (
18 18 return item.title;
19 19 }}
20 20 />
21   - {children ? (
22   - <div className={styles.content}>
23   - {children}
24   - </div>
25   - ) : null}
  21 + {children ? <div className={styles.content}>{children}</div> : null}
26 22 </div>
27 23 );
28 24
... ...
... ... @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => (
18 18 return item.title;
19 19 }}
20 20 />
21   - {children ? (
22   - <div className={styles.content}>
23   - {children}
24   - </div>
25   - ) : null}
  21 + {children ? <div className={styles.content}>{children}</div> : null}
26 22 </div>
27 23 );
28 24
... ...
... ... @@ -41,13 +41,13 @@ export default class StepForm extends PureComponent {
41 41 <Step title="确认转账信息" />
42 42 <Step title="完成" />
43 43 </Steps>
44   - {
45   - /confirm\/?$/.test(pathname) ?
46   - <Step2 /> : (
47   - /result\/?$/.test(pathname) ?
48   - <Step3 /> : <Step1 />
49   - )
50   - }
  44 + {/confirm\/?$/.test(pathname) ? (
  45 + <Step2 />
  46 + ) : /result\/?$/.test(pathname) ? (
  47 + <Step3 />
  48 + ) : (
  49 + <Step1 />
  50 + )}
51 51 </Fragment>
52 52 </Card>
53 53 </PageHeaderWrapper>
... ...
... ... @@ -2,7 +2,7 @@ export default {
2 2 'app.forms.basic.title': 'Basic form',
3 3 'app.forms.basic.description':
4 4 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.',
5   -
  5 +
6 6 'validation.email.required': 'Por favor insira seu email!',
7 7 'validation.email.wrong-format': 'O email está errado!',
8 8 'validation.userName.required': 'Por favor insira nome de usuário!',
... ...
... ... @@ -20,7 +20,7 @@ export default {
20 20 'validation.date.required': '请选择起止日期',
21 21 'validation.goal.required': '请输入目标描述',
22 22 'validation.standard.required': '请输入衡量标准',
23   -
  23 +
24 24 'form.get-captcha': '获取验证码',
25 25 'form.captcha.second': '秒',
26 26 'form.optional': '(选填)',
... ...
... ... @@ -2,7 +2,7 @@ export default {
2 2 'app.forms.basic.title': '基礎表單',
3 3 'app.forms.basic.description':
4 4 '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。',
5   -
  5 +
6 6 'validation.email.required': '請輸入郵箱地址!',
7 7 'validation.email.wrong-format': '郵箱地址格式錯誤!',
8 8 'validation.userName.required': '請輸入賬戶!',
... ...
1   -export default {
2   -
3   -};
  1 +export default {};
... ...
1   -export default {
2   -
3   -};
  1 +export default {};
... ...
1   -export default {
2   -
3   -};
  1 +export default {};
... ...
1   -export default {
2   -
3   -};
  1 +export default {};
... ...
... ... @@ -33,4 +33,4 @@ export async function updateRule(params) {
33 33 method: 'update',
34 34 },
35 35 });
36   -}
\ No newline at end of file
  36 +}
... ...
... ... @@ -69,100 +69,100 @@ class LoginPage extends Component {
69 69 const { type, autoLogin } = this.state;
70 70 return (
71 71 <UserLayout>
72   - <div className={styles.main}>
73   - <Login
74   - defaultActiveKey={type}
75   - onTabChange={this.onTabChange}
76   - onSubmit={this.handleSubmit}
77   - ref={form => {
78   - this.loginForm = form;
79   - }}
80   - >
81   - <Tab key="account" tab={formatMessage({ id: 'app.login.tab-login-credentials' })}>
82   - {login.status === 'error' &&
83   - login.type === 'account' &&
84   - !submitting &&
85   - this.renderMessage(formatMessage({ id: 'app.login.message-invalid-credentials' }))}
86   - <UserName
87   - name="userName"
88   - placeholder={`${formatMessage({ id: 'app.login.userName' })}: admin or user`}
89   - rules={[
90   - {
91   - required: true,
92   - message: formatMessage({ id: 'validation.userName.required' }),
93   - },
94   - ]}
95   - />
96   - <Password
97   - name="password"
98   - placeholder={`${formatMessage({ id: 'app.login.password' })}: ant.design`}
99   - rules={[
100   - {
101   - required: true,
102   - message: formatMessage({ id: 'validation.password.required' }),
103   - },
104   - ]}
105   - onPressEnter={() => this.loginForm.validateFields(this.handleSubmit)}
106   - />
107   - </Tab>
108   - <Tab key="mobile" tab={formatMessage({ id: 'app.login.tab-login-mobile' })}>
109   - {login.status === 'error' &&
110   - login.type === 'mobile' &&
111   - !submitting &&
112   - this.renderMessage(
113   - formatMessage({ id: 'app.login.message-invalid-verification-code' })
114   - )}
115   - <Mobile
116   - name="mobile"
117   - placeholder={formatMessage({ id: 'form.phone-number.placeholder' })}
118   - rules={[
119   - {
120   - required: true,
121   - message: formatMessage({ id: 'validation.phone-number.required' }),
122   - },
123   - {
124   - pattern: /^1\d{10}$/,
125   - message: formatMessage({ id: 'validation.phone-number.wrong-format' }),
126   - },
127   - ]}
128   - />
129   - <Captcha
130   - name="captcha"
131   - placeholder={formatMessage({ id: 'form.verification-code.placeholder' })}
132   - countDown={120}
133   - onGetCaptcha={this.onGetCaptcha}
134   - getCaptchaButtonText={formatMessage({ id: 'form.get-captcha' })}
135   - getCaptchaSecondText={formatMessage({ id: 'form.captcha.second' })}
136   - rules={[
137   - {
138   - required: true,
139   - message: formatMessage({ id: 'validation.verification-code.required' }),
140   - },
141   - ]}
142   - />
143   - </Tab>
144   - <div>
145   - <Checkbox checked={autoLogin} onChange={this.changeAutoLogin}>
146   - <FormattedMessage id="app.login.remember-me" />
147   - </Checkbox>
148   - <a style={{ float: 'right' }} href="">
149   - <FormattedMessage id="app.login.forgot-password" />
150   - </a>
151   - </div>
152   - <Submit loading={submitting}>
153   - <FormattedMessage id="app.login.login" />
154   - </Submit>
155   - <div className={styles.other}>
156   - <FormattedMessage id="app.login.sign-in-with" />
157   - <Icon type="alipay-circle" className={styles.icon} theme="outlined" />
158   - <Icon type="taobao-circle" className={styles.icon} theme="outlined" />
159   - <Icon type="weibo-circle" className={styles.icon} theme="outlined" />
160   - <Link className={styles.register} to="/user/register">
161   - <FormattedMessage id="app.login.signup" />
162   - </Link>
163   - </div>
164   - </Login>
165   - </div>
  72 + <div className={styles.main}>
  73 + <Login
  74 + defaultActiveKey={type}
  75 + onTabChange={this.onTabChange}
  76 + onSubmit={this.handleSubmit}
  77 + ref={form => {
  78 + this.loginForm = form;
  79 + }}
  80 + >
  81 + <Tab key="account" tab={formatMessage({ id: 'app.login.tab-login-credentials' })}>
  82 + {login.status === 'error' &&
  83 + login.type === 'account' &&
  84 + !submitting &&
  85 + this.renderMessage(formatMessage({ id: 'app.login.message-invalid-credentials' }))}
  86 + <UserName
  87 + name="userName"
  88 + placeholder={`${formatMessage({ id: 'app.login.userName' })}: admin or user`}
  89 + rules={[
  90 + {
  91 + required: true,
  92 + message: formatMessage({ id: 'validation.userName.required' }),
  93 + },
  94 + ]}
  95 + />
  96 + <Password
  97 + name="password"
  98 + placeholder={`${formatMessage({ id: 'app.login.password' })}: ant.design`}
  99 + rules={[
  100 + {
  101 + required: true,
  102 + message: formatMessage({ id: 'validation.password.required' }),
  103 + },
  104 + ]}
  105 + onPressEnter={() => this.loginForm.validateFields(this.handleSubmit)}
  106 + />
  107 + </Tab>
  108 + <Tab key="mobile" tab={formatMessage({ id: 'app.login.tab-login-mobile' })}>
  109 + {login.status === 'error' &&
  110 + login.type === 'mobile' &&
  111 + !submitting &&
  112 + this.renderMessage(
  113 + formatMessage({ id: 'app.login.message-invalid-verification-code' })
  114 + )}
  115 + <Mobile
  116 + name="mobile"
  117 + placeholder={formatMessage({ id: 'form.phone-number.placeholder' })}
  118 + rules={[
  119 + {
  120 + required: true,
  121 + message: formatMessage({ id: 'validation.phone-number.required' }),
  122 + },
  123 + {
  124 + pattern: /^1\d{10}$/,
  125 + message: formatMessage({ id: 'validation.phone-number.wrong-format' }),
  126 + },
  127 + ]}
  128 + />
  129 + <Captcha
  130 + name="captcha"
  131 + placeholder={formatMessage({ id: 'form.verification-code.placeholder' })}
  132 + countDown={120}
  133 + onGetCaptcha={this.onGetCaptcha}
  134 + getCaptchaButtonText={formatMessage({ id: 'form.get-captcha' })}
  135 + getCaptchaSecondText={formatMessage({ id: 'form.captcha.second' })}
  136 + rules={[
  137 + {
  138 + required: true,
  139 + message: formatMessage({ id: 'validation.verification-code.required' }),
  140 + },
  141 + ]}
  142 + />
  143 + </Tab>
  144 + <div>
  145 + <Checkbox checked={autoLogin} onChange={this.changeAutoLogin}>
  146 + <FormattedMessage id="app.login.remember-me" />
  147 + </Checkbox>
  148 + <a style={{ float: 'right' }} href="">
  149 + <FormattedMessage id="app.login.forgot-password" />
  150 + </a>
  151 + </div>
  152 + <Submit loading={submitting}>
  153 + <FormattedMessage id="app.login.login" />
  154 + </Submit>
  155 + <div className={styles.other}>
  156 + <FormattedMessage id="app.login.sign-in-with" />
  157 + <Icon type="alipay-circle" className={styles.icon} theme="outlined" />
  158 + <Icon type="taobao-circle" className={styles.icon} theme="outlined" />
  159 + <Icon type="weibo-circle" className={styles.icon} theme="outlined" />
  160 + <Link className={styles.register} to="/user/register">
  161 + <FormattedMessage id="app.login.signup" />
  162 + </Link>
  163 + </div>
  164 + </Login>
  165 + </div>
166 166 </UserLayout>
167 167 );
168 168 }
... ...
1   -
2 1 export function getPageQuery() {
3 2 return parse(window.location.href.split('?')[1]);
4 3 }
5   -
... ...
1   -
2 1 export default {
3 2 'POST /api/register': (req, res) => {
4 3 res.send({ status: 'ok', currentAuthority: 'user' });
... ...
... ... @@ -180,155 +180,155 @@ class Register extends Component {
180 180 const { count, prefix, help, visible } = this.state;
181 181 return (
182 182 <UserLayout>
183   - <div className={styles.main}>
184   - <h3>
185   - <FormattedMessage id="app.register.register" />
186   - </h3>
187   - <Form onSubmit={this.handleSubmit}>
188   - <FormItem>
189   - {getFieldDecorator('mail', {
190   - rules: [
191   - {
192   - required: true,
193   - message: formatMessage({ id: 'validation.email.required' }),
194   - },
195   - {
196   - type: 'email',
197   - message: formatMessage({ id: 'validation.email.wrong-format' }),
198   - },
199   - ],
200   - })(
201   - <Input size="large" placeholder={formatMessage({ id: 'form.email.placeholder' })} />
202   - )}
203   - </FormItem>
204   - <FormItem help={help}>
205   - <Popover
206   - getPopupContainer={node => node.parentNode}
207   - content={
208   - <div style={{ padding: '4px 0' }}>
209   - {passwordStatusMap[this.getPasswordStatus()]}
210   - {this.renderPasswordProgress()}
211   - <div style={{ marginTop: 10 }}>
212   - <FormattedMessage id="validation.password.strength.msg" />
213   - </div>
214   - </div>
215   - }
216   - overlayStyle={{ width: 240 }}
217   - placement="right"
218   - visible={visible}
219   - >
220   - {getFieldDecorator('password', {
  183 + <div className={styles.main}>
  184 + <h3>
  185 + <FormattedMessage id="app.register.register" />
  186 + </h3>
  187 + <Form onSubmit={this.handleSubmit}>
  188 + <FormItem>
  189 + {getFieldDecorator('mail', {
221 190 rules: [
222 191 {
223   - validator: this.checkPassword,
  192 + required: true,
  193 + message: formatMessage({ id: 'validation.email.required' }),
  194 + },
  195 + {
  196 + type: 'email',
  197 + message: formatMessage({ id: 'validation.email.wrong-format' }),
224 198 },
225 199 ],
226 200 })(
227   - <Input
228   - size="large"
229   - type="password"
230   - placeholder={formatMessage({ id: 'form.password.placeholder' })}
231   - />
  201 + <Input size="large" placeholder={formatMessage({ id: 'form.email.placeholder' })} />
232 202 )}
233   - </Popover>
234   - </FormItem>
235   - <FormItem>
236   - {getFieldDecorator('confirm', {
237   - rules: [
238   - {
239   - required: true,
240   - message: formatMessage({ id: 'validation.confirm-password.required' }),
241   - },
242   - {
243   - validator: this.checkConfirm,
244   - },
245   - ],
246   - })(
247   - <Input
248   - size="large"
249   - type="password"
250   - placeholder={formatMessage({ id: 'form.confirm-password.placeholder' })}
251   - />
252   - )}
253   - </FormItem>
254   - <FormItem>
255   - <InputGroup compact>
256   - <Select
257   - size="large"
258   - value={prefix}
259   - onChange={this.changePrefix}
260   - style={{ width: '20%' }}
  203 + </FormItem>
  204 + <FormItem help={help}>
  205 + <Popover
  206 + getPopupContainer={node => node.parentNode}
  207 + content={
  208 + <div style={{ padding: '4px 0' }}>
  209 + {passwordStatusMap[this.getPasswordStatus()]}
  210 + {this.renderPasswordProgress()}
  211 + <div style={{ marginTop: 10 }}>
  212 + <FormattedMessage id="validation.password.strength.msg" />
  213 + </div>
  214 + </div>
  215 + }
  216 + overlayStyle={{ width: 240 }}
  217 + placement="right"
  218 + visible={visible}
261 219 >
262   - <Option value="86">+86</Option>
263   - <Option value="87">+87</Option>
264   - </Select>
265   - {getFieldDecorator('mobile', {
  220 + {getFieldDecorator('password', {
  221 + rules: [
  222 + {
  223 + validator: this.checkPassword,
  224 + },
  225 + ],
  226 + })(
  227 + <Input
  228 + size="large"
  229 + type="password"
  230 + placeholder={formatMessage({ id: 'form.password.placeholder' })}
  231 + />
  232 + )}
  233 + </Popover>
  234 + </FormItem>
  235 + <FormItem>
  236 + {getFieldDecorator('confirm', {
266 237 rules: [
267 238 {
268 239 required: true,
269   - message: formatMessage({ id: 'validation.phone-number.required' }),
  240 + message: formatMessage({ id: 'validation.confirm-password.required' }),
270 241 },
271 242 {
272   - pattern: /^\d{11}$/,
273   - message: formatMessage({ id: 'validation.phone-number.wrong-format' }),
  243 + validator: this.checkConfirm,
274 244 },
275 245 ],
276 246 })(
277 247 <Input
278 248 size="large"
279   - style={{ width: '80%' }}
280   - placeholder={formatMessage({ id: 'form.phone-number.placeholder' })}
  249 + type="password"
  250 + placeholder={formatMessage({ id: 'form.confirm-password.placeholder' })}
281 251 />
282 252 )}
283   - </InputGroup>
284   - </FormItem>
285   - <FormItem>
286   - <Row gutter={8}>
287   - <Col span={16}>
288   - {getFieldDecorator('captcha', {
  253 + </FormItem>
  254 + <FormItem>
  255 + <InputGroup compact>
  256 + <Select
  257 + size="large"
  258 + value={prefix}
  259 + onChange={this.changePrefix}
  260 + style={{ width: '20%' }}
  261 + >
  262 + <Option value="86">+86</Option>
  263 + <Option value="87">+87</Option>
  264 + </Select>
  265 + {getFieldDecorator('mobile', {
289 266 rules: [
290 267 {
291 268 required: true,
292   - message: formatMessage({ id: 'validation.verification-code.required' }),
  269 + message: formatMessage({ id: 'validation.phone-number.required' }),
  270 + },
  271 + {
  272 + pattern: /^\d{11}$/,
  273 + message: formatMessage({ id: 'validation.phone-number.wrong-format' }),
293 274 },
294 275 ],
295 276 })(
296 277 <Input
297 278 size="large"
298   - placeholder={formatMessage({ id: 'form.verification-code.placeholder' })}
  279 + style={{ width: '80%' }}
  280 + placeholder={formatMessage({ id: 'form.phone-number.placeholder' })}
299 281 />
300 282 )}
301   - </Col>
302   - <Col span={8}>
303   - <Button
304   - size="large"
305   - disabled={count}
306   - className={styles.getCaptcha}
307   - onClick={this.onGetCaptcha}
308   - >
309   - {count
310   - ? `${count} s`
311   - : formatMessage({ id: 'app.register.get-verification-code' })}
312   - </Button>
313   - </Col>
314   - </Row>
315   - </FormItem>
316   - <FormItem>
317   - <Button
318   - size="large"
319   - loading={submitting}
320   - className={styles.submit}
321   - type="primary"
322   - htmlType="submit"
323   - >
324   - <FormattedMessage id="app.register.register" />
325   - </Button>
326   - <Link className={styles.login} to="/User/Login">
327   - <FormattedMessage id="app.register.sign-in" />
328   - </Link>
329   - </FormItem>
330   - </Form>
331   - </div>
  283 + </InputGroup>
  284 + </FormItem>
  285 + <FormItem>
  286 + <Row gutter={8}>
  287 + <Col span={16}>
  288 + {getFieldDecorator('captcha', {
  289 + rules: [
  290 + {
  291 + required: true,
  292 + message: formatMessage({ id: 'validation.verification-code.required' }),
  293 + },
  294 + ],
  295 + })(
  296 + <Input
  297 + size="large"
  298 + placeholder={formatMessage({ id: 'form.verification-code.placeholder' })}
  299 + />
  300 + )}
  301 + </Col>
  302 + <Col span={8}>
  303 + <Button
  304 + size="large"
  305 + disabled={count}
  306 + className={styles.getCaptcha}
  307 + onClick={this.onGetCaptcha}
  308 + >
  309 + {count
  310 + ? `${count} s`
  311 + : formatMessage({ id: 'app.register.get-verification-code' })}
  312 + </Button>
  313 + </Col>
  314 + </Row>
  315 + </FormItem>
  316 + <FormItem>
  317 + <Button
  318 + size="large"
  319 + loading={submitting}
  320 + className={styles.submit}
  321 + type="primary"
  322 + htmlType="submit"
  323 + >
  324 + <FormattedMessage id="app.register.register" />
  325 + </Button>
  326 + <Link className={styles.login} to="/User/Login">
  327 + <FormattedMessage id="app.register.sign-in" />
  328 + </Link>
  329 + </FormItem>
  330 + </Form>
  331 + </div>
332 332 </UserLayout>
333 333 );
334 334 }
... ...
... ... @@ -20,11 +20,7 @@ const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...r
20 20 return item.title;
21 21 }}
22 22 />
23   - {children ? (
24   - <div className={styles.content}>
25   - { children }
26   - </div>
27   - ) : null}
  23 + {children ? <div className={styles.content}>{children}</div> : null}
28 24 </div>
29 25 );
30 26
... ...
... ... @@ -113,4 +113,4 @@ export default {
113 113 });
114 114 },
115 115 },
116   -}
  116 +};
... ...
注册登录 后发表评论