mirror of
https://gitee.com/johng/gf
synced 2026-06-07 10:22:11 +08:00
修复gvalid多条数据校验时,规则key没有对应校验数据导致校验异常的问题。
This commit is contained in:
@ -86,6 +86,9 @@ func CheckMap(params interface{}, rules interface{}, msgs ...CustomMsg) *Error {
|
||||
value = nil
|
||||
if v, ok := data[key]; ok {
|
||||
value = v
|
||||
} else {
|
||||
// 规则key没有对应需要校验的数据,那么不执行校验
|
||||
continue
|
||||
}
|
||||
if e := Check(value, rule, customMsgs[key], data); e != nil {
|
||||
_, item := e.FirstItem()
|
||||
|
||||
Reference in New Issue
Block a user