fix🐛 :修复请求日志数据获取为空问题

This commit is contained in:
wenjianzhang committed 2021-03-17 11:15:35 +08:00
1 parent 51bc4423f7
commit a8c00c5be1
1 file changed
+2 -2
+2 -2
View File
@@ -21,7 +21,7 @@ import (
// LoggerToFile 日志记录到文件 // LoggerToFile 日志记录到文件
func LoggerToFile() gin.HandlerFunc { func LoggerToFile() gin.HandlerFunc {
return func(c *gin.Context) { return func(c *gin.Context) {
defer c.Next() c.Next()
if c.Request.Method == http.MethodOptions { if c.Request.Method == http.MethodOptions {
return return
} }
@@ -136,4 +136,4 @@ func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string
serviceOperaLog.Orm = db serviceOperaLog.Orm = db
serviceOperaLog.Log = log serviceOperaLog.Log = log
_ = serviceOperaLog.InsertSysOperaLog(&sysOperaLog) _ = serviceOperaLog.InsertSysOperaLog(&sysOperaLog)
} }