From 37c8fb7c5e67af67faa77df62e0627b9197724b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 8 Apr 2019 14:30:13 +0800 Subject: [PATCH] feat: add login message (#3918) * feat: add login message * doc: change message text --- src/locales/en-US/login.js | 2 ++ src/locales/pt-BR/login.js | 2 ++ src/locales/zh-CN/login.js | 2 ++ src/locales/zh-TW/login.js | 2 ++ src/pages/User/Login.js | 3 ++- src/pages/User/Register.js | 3 ++- 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/locales/en-US/login.js b/src/locales/en-US/login.js index 82c1c20f..195e59ce 100644 --- a/src/locales/en-US/login.js +++ b/src/locales/en-US/login.js @@ -12,6 +12,8 @@ export default { 'app.login.login': 'Login', 'app.register.register': 'Register', 'app.register.get-verification-code': 'Get code', + 'app.login.verification-code-warning': + 'This project is a demo project and will not actually send you a verification code. Please switch to the account password login interface and log in as prompted.', 'app.register.sign-in': 'Already have an account?', 'app.register-result.msg': 'Account:registered at {email}', 'app.register-result.activation-email': diff --git a/src/locales/pt-BR/login.js b/src/locales/pt-BR/login.js index 453b3dac..5e2d8695 100644 --- a/src/locales/pt-BR/login.js +++ b/src/locales/pt-BR/login.js @@ -13,6 +13,8 @@ export default { 'app.login.login': 'Login', 'app.register.register': 'Cadastro', 'app.register.get-verification-code': 'Recuperar código', + 'app.login.verification-code-warning': + 'This project is a demo project and will not actually send you a verification code. Please switch to the account password login interface and log in as prompted.', 'app.register.sign-in': 'Já tem uma conta?', 'app.register-result.msg': 'Conta:registrada em {email}', 'app.register-result.activation-email': diff --git a/src/locales/zh-CN/login.js b/src/locales/zh-CN/login.js index eb227207..e211e2cf 100644 --- a/src/locales/zh-CN/login.js +++ b/src/locales/zh-CN/login.js @@ -12,6 +12,8 @@ export default { 'app.login.login': '登录', 'app.register.register': '注册', 'app.register.get-verification-code': '获取验证码', + 'app.login.verification-code-warning': + '此项目为演示项目,并不会真的给您发送验证码。请切换到账户密码登录界面按提示登录。', 'app.register.sign-in': '使用已有账户登录', 'app.register-result.msg': '你的账户:{email} 注册成功', 'app.register-result.activation-email': diff --git a/src/locales/zh-TW/login.js b/src/locales/zh-TW/login.js index ec5706a6..fb916603 100644 --- a/src/locales/zh-TW/login.js +++ b/src/locales/zh-TW/login.js @@ -12,6 +12,8 @@ export default { 'app.login.login': '登錄', 'app.register.register': '註冊', 'app.register.get-verification-code': '獲取驗證碼', + 'app.login.verification-code-warning': + '此項目為演示項目,並不會真的給您發送驗證碼。請切換到賬戶密碼登錄界面按提示登錄。', 'app.register.sign-in': '使用已有賬戶登錄', 'app.register-result.msg': '妳的賬戶:{email} 註冊成功', 'app.register-result.activation-email': diff --git a/src/pages/User/Login.js b/src/pages/User/Login.js index e3498bd3..29f59c89 100644 --- a/src/pages/User/Login.js +++ b/src/pages/User/Login.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { connect } from 'dva'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; -import { Checkbox, Alert, Icon } from 'antd'; +import { Checkbox, Alert, message, Icon } from 'antd'; import Login from '@/components/Login'; import styles from './Login.less'; @@ -35,6 +35,7 @@ class LoginPage extends Component { }) .then(resolve) .catch(reject); + message.warning(formatMessage({ id: 'app.login.verification-code-warning' })); } }); }); diff --git a/src/pages/User/Register.js b/src/pages/User/Register.js index d685965f..6aab8ffb 100644 --- a/src/pages/User/Register.js +++ b/src/pages/User/Register.js @@ -3,7 +3,7 @@ import { connect } from 'dva'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import router from 'umi/router'; -import { Form, Input, Button, Select, Row, Col, Popover, Progress } from 'antd'; +import { Form, Input, Button, message, Select, Row, Col, Popover, Progress } from 'antd'; import styles from './Register.less'; const FormItem = Form.Item; @@ -75,6 +75,7 @@ class Register extends Component { clearInterval(this.interval); } }, 1000); + message.warning(formatMessage({ id: 'app.login.verification-code-warning' })); }; getPasswordStatus = () => { -- GitLab