aa
This commit is contained in:
@@ -63,7 +63,7 @@ func Login(c *gin.Context) {
|
|||||||
user = &UserParam{}
|
user = &UserParam{}
|
||||||
)
|
)
|
||||||
globals.SugarLogger.Debugf("Begin API :%s params: %v ip: %s", c.Request.URL, "", c.ClientIP())
|
globals.SugarLogger.Debugf("Begin API :%s params: %v ip: %s", c.Request.URL, "", c.ClientIP())
|
||||||
if err = c.Bind(&user); err != nil {
|
if err = c.ShouldBind(&user); err != nil {
|
||||||
c.JSON(http.StatusOK, &CallBack{
|
c.JSON(http.StatusOK, &CallBack{
|
||||||
Code: model.ErrCodeNormal,
|
Code: model.ErrCodeNormal,
|
||||||
Desc: err.Error(),
|
Desc: err.Error(),
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
_ "git.rosy.net.cn/jx-print/controllers"
|
_ "git.rosy.net.cn/jx-print/controllers"
|
||||||
"git.rosy.net.cn/jx-print/globals"
|
"git.rosy.net.cn/jx-print/globals"
|
||||||
@@ -46,6 +47,7 @@ func middleware() gin.HandlerFunc {
|
|||||||
return func(c *gin.Context) {
|
return func(c *gin.Context) {
|
||||||
data, _ := ioutil.ReadAll(c.Request.Body)
|
data, _ := ioutil.ReadAll(c.Request.Body)
|
||||||
globals.SugarLogger.Debugf("Begin API :%s params: %v ip: %s", c.Request.URL, string(data), c.ClientIP())
|
globals.SugarLogger.Debugf("Begin API :%s params: %v ip: %s", c.Request.URL, string(data), c.ClientIP())
|
||||||
|
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user