|
@@ -8,6 +8,7 @@ import apiUser from '../../api/apiUser';
|
|
|
import Button from '../../components/Button';
|
|
import Button from '../../components/Button';
|
|
|
import Dialog from '../../components/Dialog';
|
|
import Dialog from '../../components/Dialog';
|
|
|
import { BackIcon } from '../../components/Toolbar';
|
|
import { BackIcon } from '../../components/Toolbar';
|
|
|
|
|
+import utils from '../../utils/utils';
|
|
|
import { StrengthView } from './Register';
|
|
import { StrengthView } from './Register';
|
|
|
|
|
|
|
|
export default class ResetPassword extends Component {
|
|
export default class ResetPassword extends Component {
|
|
@@ -72,11 +73,11 @@ export default class ResetPassword extends Component {
|
|
|
sendVerification() {
|
|
sendVerification() {
|
|
|
var info = this.formInfo;
|
|
var info = this.formInfo;
|
|
|
if (!info.email) {
|
|
if (!info.email) {
|
|
|
- toastShort('Please enter email address');
|
|
|
|
|
|
|
+ toastShort($t('sign.plsInputEmail'));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (!/^[a-zA-Z0-9]+[\S]+@[a-zA-Z0-9_-]+[\.][\Sa-zA-Z]+$/.test(info.email)) {
|
|
|
|
|
- toastShort('Email is incorrect format');
|
|
|
|
|
|
|
+ if (!utils.isValidEmail(info.email)) {
|
|
|
|
|
+ toastShort($t('sign.errEmailFormat'));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
Dialog.showProgressDialog()
|
|
Dialog.showProgressDialog()
|
|
@@ -106,11 +107,11 @@ export default class ResetPassword extends Component {
|
|
|
var info = this.formInfo;
|
|
var info = this.formInfo;
|
|
|
console.log('reset info', info);
|
|
console.log('reset info', info);
|
|
|
if (!info.email) {
|
|
if (!info.email) {
|
|
|
- toastShort('Please enter email address');
|
|
|
|
|
|
|
+ toastShort($t('sign.plsInputEmail'));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (!/^[a-zA-Z0-9]+[\S]+@[a-zA-Z0-9_-]+[\.][\Sa-zA-Z]+$/.test(info.email)) {
|
|
|
|
|
- toastShort('Email is incorrect format');
|
|
|
|
|
|
|
+ if (!utils.isValidEmail(info.email)) {
|
|
|
|
|
+ toastShort($t('sign.errEmailFormat'));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (!this.state.password) {
|
|
if (!this.state.password) {
|