入口处统一支持去空格

This commit is contained in:
zhangdeman committed 2024-05-16 20:46:53 +08:00
1 parent 2d8d05044c
commit 84d515bce2
1 file changed
+5 -2
+5 -2
View File
@@ -131,8 +131,11 @@ func formatInputVal(val gjson.Result, rule *define.FieldRule) (any, error) {
inputVal = strings.TrimSpace(rule.DefaultValue)
}
} 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
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.