From d6b975ffc8b6b8da544dafee39de1de6b50c6388 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Thu, 12 Oct 2023 18:09:56 +0800 Subject: [PATCH] update --- app/customer/hdl/hdl_login.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 }