增加限制条件

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
+3 -2
View File
@@ -17,12 +17,13 @@ var OrderCtr = Ctr{
providerId := ObjToInt(that.Req.FormValue("provider_id"))
phone := that.Req.FormValue("phone")
companyName := that.Req.FormValue("company_name")
if providerId == 0 || len(phone) != 11 || len(companyName) < 4 {
userName := that.Req.FormValue("user_name")
if providerId == 0 || 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 {
that.Display(3, err.Error())
return