feat(123): support mail login (close #2218 pr #2276)

This commit is contained in:
Code2qing
2022-11-10 09:34:48 +08:00
committed by GitHub
parent 42865486f1
commit c601bb794b
2 changed files with 24 additions and 4 deletions

9
pkg/utils/email.go Normal file
View File

@ -0,0 +1,9 @@
package utils
import "regexp"
func IsEmailFormat(email string) bool {
pattern := `^[0-9a-z][_.0-9a-z-]{0,31}@([0-9a-z][0-9a-z-]{0,30}[0-9a-z]\.){1,4}[a-z]{2,4}$`
reg := regexp.MustCompile(pattern)
return reg.MatchString(email)
}