fix: fixed bug for upload image failed

This commit is contained in:
RockYang 2023-11-29 17:46:46 +08:00
parent de42a428e6
commit dae91ed243

View File

@ -232,6 +232,12 @@ func parameterHandlerMiddleware() gin.HandlerFunc {
// 更新参数
c.Request.URL.RawQuery = params.Encode()
contentType := c.Request.Header.Get("Content-Type")
if strings.Contains(contentType, "multipart/form-data") {
c.Next()
return
}
// POST JSON 参数处理
bodyBytes, err := io.ReadAll(c.Request.Body)
if err != nil {