From 24c064fec2012303e3e6aa13efa6632a3b02097f Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Thu, 15 Jul 2021 17:45:55 +0800 Subject: [PATCH] a --- controllers/user_controller.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/controllers/user_controller.go b/controllers/user_controller.go index cb67e9b..9fa89dd 100644 --- a/controllers/user_controller.go +++ b/controllers/user_controller.go @@ -62,10 +62,8 @@ func Login(c *gin.Context) { err error user = &UserParam{} ) - err = c.Bind(&user) - data, _ := ioutil.ReadAll(c.Request.Body) - globals.SugarLogger.Debugf("Begin API :%s params: %v ip: %s", c.Request.URL, string(data), c.ClientIP()) - if err != nil { + globals.SugarLogger.Debugf("Begin API :%s params: %v ip: %s", c.Request.URL, utils.Format4Output(c.Request, true), c.ClientIP()) + if err = c.ShouldBind(&user); err != nil { c.JSON(http.StatusOK, &CallBack{ Code: model.ErrCodeNormal, Desc: err.Error(),