mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-14 02:10:00 +08:00
fix(httpx): support array field for request dto (#4026)
Co-authored-by: yshi3 <yshi3@tesla.com>
This commit is contained in:
@@ -21,9 +21,10 @@ func GetFormValues(r *http.Request) (map[string]any, error) {
|
||||
|
||||
params := make(map[string]any, len(r.Form))
|
||||
for name := range r.Form {
|
||||
formValue := r.Form.Get(name)
|
||||
if len(formValue) > 0 {
|
||||
params[name] = formValue
|
||||
if len(r.Form[name]) > 1 {
|
||||
params[name] = r.Form[name]
|
||||
} else if len(r.Form[name]) == 1 {
|
||||
params[name] = r.Form.Get(name)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user