diff --git a/app/customer/hdl/hdl_login.go b/app/customer/hdl/hdl_login.go index cc891b3..6593919 100644 --- a/app/customer/hdl/hdl_login.go +++ b/app/customer/hdl/hdl_login.go @@ -185,11 +185,11 @@ func Register(c *gin.Context) { return } // 编译正则表达式 - pattern := `^1[3456789]d{9}$` - reg := regexp.MustCompile(pattern) + pattern := `^1[3456789]\d{9}$` + r := regexp.MustCompile(pattern) // 验证手机号码 - if !reg.MatchString(req.Phone) { + if !r.MatchString(req.Phone) { e.OutErr(c, e.ERR, "非法手机号") return }