From 7c9026a9a22132d21308926992de4995c0ecfd37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9E=E5=BF=97=E5=88=9A?= Date: Fri, 9 Nov 2018 19:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=9B=BD=E9=99=85=E5=8C=96=EF=BC=8C=20Fix=20?= =?UTF-8?q?#2790=20.=20(#2810)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: PangZhiGang <306888588@qq.com> --- src/components/Login/LoginItem.js | 9 ++++++--- src/components/Login/index.less | 5 +++++ src/layouts/UserLayout.less | 2 +- src/locales/en-US.js | 2 ++ src/locales/pt-BR.js | 2 ++ src/locales/zh-CN.js | 2 ++ src/locales/zh-TW.js | 2 ++ 7 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/components/Login/LoginItem.js b/src/components/Login/LoginItem.js index cc32ec1d..0f45a7fd 100644 --- a/src/components/Login/LoginItem.js +++ b/src/components/Login/LoginItem.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import { Form, Input, Button, Row, Col } from 'antd'; +import { formatMessage } from 'umi/locale'; import omit from 'omit.js'; import styles from './index.less'; import ItemMap from './map'; @@ -9,7 +10,8 @@ const FormItem = Form.Item; class WrapFormItem extends Component { static defaultProps = { - buttonText: '获取验证码', + getCaptchaButtonText: formatMessage({ id: 'form.captcha' }), + getCaptchaSecondText: formatMessage({ id: 'form.captcha.second' }), }; constructor(props) { @@ -83,7 +85,8 @@ class WrapFormItem extends Component { defaultValue, rules, name, - buttonText, + getCaptchaButtonText, + getCaptchaSecondText, updateActive, type, ...restProps @@ -108,7 +111,7 @@ class WrapFormItem extends Component { size="large" onClick={this.onGetCaptcha} > - {count ? `${count} s` : buttonText} + {count ? `${count} ${getCaptchaSecondText}` : getCaptchaButtonText} diff --git a/src/components/Login/index.less b/src/components/Login/index.less index 995b68d2..646b6631 100644 --- a/src/components/Login/index.less +++ b/src/components/Login/index.less @@ -13,6 +13,11 @@ } } + .getCaptcha { + display: block; + width: 100%; + } + .icon { font-size: 24px; color: rgba(0, 0, 0, 0.2); diff --git a/src/layouts/UserLayout.less b/src/layouts/UserLayout.less index 0e1ff2f0..5eb257a4 100644 --- a/src/layouts/UserLayout.less +++ b/src/layouts/UserLayout.less @@ -32,7 +32,7 @@ } .content { - padding: 72px 0 24px 0; + padding: 32px 0 24px 0; } } diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 3bb7a89b..fcc702c0 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -20,6 +20,8 @@ export default { 'validation.date.required': 'Please select the start and end date', 'validation.goal.required': 'Please enter a description of the goal', 'validation.standard.required': 'Please enter a metric', + 'form.captcha': 'Get Captcha', + 'form.captcha.second': 'sec', 'form.optional': ' (optional) ', 'form.submit': 'Submit', 'form.save': 'Save', diff --git a/src/locales/pt-BR.js b/src/locales/pt-BR.js index 241600f5..f4677986 100644 --- a/src/locales/pt-BR.js +++ b/src/locales/pt-BR.js @@ -16,6 +16,8 @@ export default { 'validation.phone-number.required': 'Por favor insira seu telefone!', 'validation.phone-number.wrong-format': 'Formato de telefone errado!', 'validation.verification-code.required': 'Por favor insira seu código de verificação!', + 'form.captcha': 'Get Captcha', + 'form.captcha.second': 'sec', 'form.email.placeholder': 'Email', 'form.password.placeholder': 'Senha', 'form.confirm-password.placeholder': 'Confirme a senha', diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index 376d3cb9..d34cd287 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -19,6 +19,8 @@ export default { 'validation.date.required': '请选择起止日期', 'validation.goal.required': '请输入目标描述', 'validation.standard.required': '请输入衡量标准', + 'form.captcha': '获取验证码', + 'form.captcha.second': '秒', 'form.optional': '(选填)', 'form.submit': '提交', 'form.save': '保存', diff --git a/src/locales/zh-TW.js b/src/locales/zh-TW.js index 56cef40d..863dda85 100644 --- a/src/locales/zh-TW.js +++ b/src/locales/zh-TW.js @@ -19,6 +19,8 @@ export default { 'validation.date.required': '請選擇起止日期', 'validation.goal.required': '請輸入目標描述', 'validation.standard.required': '請輸入衡量標淮', + 'form.captcha': '獲取驗證碼', + 'form.captcha.second': '秒', 'form.optional': '(選填)', 'form.submit': '提交', 'form.save': '保存', -- GitLab