Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
d6b975ffc8
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      app/customer/hdl/hdl_login.go

+ 3
- 3
app/customer/hdl/hdl_login.go View File

@@ -185,11 +185,11 @@ func Register(c *gin.Context) {
return 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, "非法手机号") e.OutErr(c, e.ERR, "非法手机号")
return return
} }


Loading…
Cancel
Save