入口处统一支持去空格
This commit is contained in:
parent
2d8d05044c
commit
84d515bce2
7
run.go
7
run.go
@ -131,8 +131,11 @@ func formatInputVal(val gjson.Result, rule *define.FieldRule) (any, error) {
|
|||||||
inputVal = strings.TrimSpace(rule.DefaultValue)
|
inputVal = strings.TrimSpace(rule.DefaultValue)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if !rule.DisableAutoConvert {
|
if inputValStr, ok := inputVal.(string); ok {
|
||||||
if inputValStr, ok := inputVal.(string); ok {
|
if rule.AutoTrimSpace {
|
||||||
|
// 自动去空格
|
||||||
|
inputVal = strings.TrimSpace(inputValStr)
|
||||||
|
} else {
|
||||||
inputVal = inputValStr
|
inputVal = inputValStr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user