fix: 修复邮箱大写报错的问题

This commit is contained in:
kuaifan 2022-02-23 10:03:15 +08:00
parent 10ff02b8a0
commit af8344c555
2 changed files with 8 additions and 1 deletions

View File

@ -360,7 +360,7 @@
* @returns {boolean}
*/
isEmail(email) {
return /^[a-z0-9][a-z\.0-9-_]+@[a-z0-9_-]+(?:\.[a-z]{0,3}\.[a-z]{0,2}|\.[a-z]{0,3}|\.[a-z]{0,2})$/.test(email);
return /^[a-z0-9][a-z\.0-9-_]+@[a-z0-9_-]+(?:\.[a-z]{0,3}\.[a-z]{0,2}|\.[a-z]{0,3}|\.[a-z]{0,2})$/i.test(email);
},
/**

View File

@ -81,6 +81,7 @@ export default {
loginType: 'login',
loginJump: false,
email: $A.getStorageString("cacheLoginEmail") || '',
password: '',
password2: '',
@ -277,6 +278,12 @@ export default {
onLogin() {
this.chackServerUrl(true).then(() => {
this.email = $A.trim(this.email)
this.password = $A.trim(this.password)
this.password2 = $A.trim(this.password2)
this.code = $A.trim(this.code)
this.invite = $A.trim(this.invite)
//
if (!$A.isEmail(this.email)) {
$A.messageWarning("请输入正确的邮箱地址");
return;