增加限制条件

This commit is contained in:
hoteas
2022-05-06 11:35:40 +08:00
parent aea2e0241d
commit 4cbc84063a
7 changed files with 87 additions and 48 deletions
+7 -1
View File
@@ -65,8 +65,14 @@ var UpanCtr = Ctr{
phone := that.Req.FormValue("phone")
companyName := that.Req.FormValue("company_name")
userName := that.Req.FormValue("user_name")
if len(phone) != 11 || len(companyName) < 4 || len(userName) < 2 {
that.Display(3, "请求参数异常")
return
}
//验证不成功则反馈
err := auth(that, phone, companyName)
err := auth(that, phone, companyName, userName)
if err != nil {
fmt.Println(err)
that.Display(3, err.Error())