|
@@ -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 |
|
|
} |
|
|
} |
|
|