fix: fixed bug for upload image failed

This commit is contained in:
RockYang 2023-11-29 17:46:46 +08:00
parent eb36d0742a
commit 5a799139cd

View File

@ -232,6 +232,12 @@ func parameterHandlerMiddleware() gin.HandlerFunc {
// 更新参数 // 更新参数
c.Request.URL.RawQuery = params.Encode() 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 参数处理 // POST JSON 参数处理
bodyBytes, err := io.ReadAll(c.Request.Body) bodyBytes, err := io.ReadAll(c.Request.Body)
if err != nil { if err != nil {