作者 yangfu

1.路由修改

@@ -35,7 +35,6 @@ func CreateResponseLogFilter(logger *logs.BeeLogger) func(ctx *context.Context) @@ -35,7 +35,6 @@ func CreateResponseLogFilter(logger *logs.BeeLogger) func(ctx *context.Context)
35 35
36 func CreateRequestBodyFilter() func(ctx *context.Context) { 36 func CreateRequestBodyFilter() func(ctx *context.Context) {
37 return func(ctx *context.Context) { 37 return func(ctx *context.Context) {
38 - if len(ctx.Input.RequestBody) == 0 {  
39 if ctx.Request.Method == http.MethodPost || ctx.Request.Method == http.MethodPut { 38 if ctx.Request.Method == http.MethodPost || ctx.Request.Method == http.MethodPut {
40 body, _ := ioutil.ReadAll(ctx.Request.Body) 39 body, _ := ioutil.ReadAll(ctx.Request.Body)
41 if len(body) == 0 { 40 if len(body) == 0 {
@@ -44,8 +43,10 @@ func CreateRequestBodyFilter() func(ctx *context.Context) { @@ -44,8 +43,10 @@ func CreateRequestBodyFilter() func(ctx *context.Context) {
44 ctx.Input.SetData("requestBody", body) 43 ctx.Input.SetData("requestBody", body)
45 ctx.Request.Body.Close() 44 ctx.Request.Body.Close()
46 } 45 }
47 - } else {  
48 - ctx.Input.SetData("requestBody", ctx.Input.RequestBody)  
49 - } 46 + //if len(ctx.Input.RequestBody) == 0 {
  47 + //
  48 + //} else {
  49 + // ctx.Input.SetData("requestBody", ctx.Input.RequestBody)
  50 + //}
50 } 51 }
51 } 52 }