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