fix both modify

This commit is contained in:
2024-07-26 14:47:00 +08:00
9 changed files with 329 additions and 142 deletions

View File

@ -36,10 +36,10 @@ type form struct {
//
// Date : 00:34 2022/7/3
func (f *form) Parse(ctx *gin.Context, receiver interface{}) error {
handleConfig := define.GetHttpHandleConfig()
requestBody, _ := io.ReadAll(ctx.Request.Body)
// 请求信息写入上下文
ctx.Set(define.RecordRequestDataField, string(requestBody))
ctx.Set(handleConfig.RecordRequestDataField, string(requestBody))
// 因为请求体被读一遍之后就没了,重新赋值 requestBody
ctx.Request.Body = io.NopCloser(bytes.NewReader(requestBody))
method := strings.ToUpper(ctx.Request.Method)