simplify email validator #261

This commit is contained in:
hay-kot 2021-04-05 18:43:56 -08:00
commit 93890bb93d

View file

@ -3,7 +3,7 @@ export const validators = {
return {
emailRule: v =>
!v ||
/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) ||
/^[^@\s]+@[^@\s.]+.[^@.\s]+$/.test(v) ||
this.$t('user.e-mail-must-be-valid'),
existsRule: value => !!value || this.$t('general.field-required'),