fix 调整手机号校验的规则 (#134)

This commit is contained in:
二丫讲梵 2022-12-12 11:52:05 +08:00 committed by GitHub
parent aa8b272531
commit a5b68c19a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ func init() {
}
func checkMobile(fl validator.FieldLevel) bool {
reg := `^1([38][0-9]|14[579]|5[^4]|16[6]|7[1-35-8]|9[189])\d{8}$`
reg := `^1(3[0-2]|4[5-9]|5[0-35-9]|6[2-8]|7[1-9]|8[1-35-8]|9[89])\d{8}$`
rgx := regexp.MustCompile(reg)
return rgx.MatchString(fl.Field().String())
}

View File

@ -28,7 +28,7 @@ func InitValidate() {
}
func checkMobile(fl validator.FieldLevel) bool {
reg := `^1([38][0-9]|14[579]|5[^4]|16[6]|7[1-35-8]|9[189])\d{8}$`
reg := `^1(3[0-2]|4[5-9]|5[0-35-9]|6[2-8]|7[1-9]|8[1-35-8]|9[89])\d{8}$`
rgx := regexp.MustCompile(reg)
return rgx.MatchString(fl.Field().String())
}