diff --git a/src/framework/utils/ctx/ctx.go b/src/framework/utils/ctx/ctx.go index cc17a092..b9f2f1e6 100644 --- a/src/framework/utils/ctx/ctx.go +++ b/src/framework/utils/ctx/ctx.go @@ -14,7 +14,6 @@ import ( "golang.org/x/text/language" "github.com/gin-gonic/gin" - "github.com/gin-gonic/gin/binding" ) // QueryMap 查询参数转换Map @@ -30,7 +29,7 @@ func QueryMap(c *gin.Context) map[string]any { // BodyJSONMap JSON参数转换Map func BodyJSONMap(c *gin.Context) map[string]any { params := make(map[string]any) - c.ShouldBindBodyWith(¶ms, binding.JSON) + c.ShouldBindBodyWithJSON(¶ms) return params } @@ -39,7 +38,7 @@ func RequestParamsMap(c *gin.Context) map[string]any { params := make(map[string]any) // json if strings.HasPrefix(c.ContentType(), "application/json") { - c.ShouldBindBodyWith(¶ms, binding.JSON) + c.ShouldBindBodyWithJSON(¶ms) } // 表单