mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
refactor🎨: 开放接口无需认证
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
gaConfig "go-admin/config"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@@ -80,6 +81,11 @@ func LoggerToFile() gin.HandlerFunc {
|
||||
statusCode := c.Writer.Status()
|
||||
// 请求IP
|
||||
clientIP := c.ClientIP()
|
||||
|
||||
|
||||
fmt.Println("Headers:", c.Request.Header.Get("X-Real-IP"))
|
||||
|
||||
fmt.Println("clientIP:", clientIP)
|
||||
// 执行时间
|
||||
latencyTime := endTime.Sub(startTime)
|
||||
// 日志格式
|
||||
@@ -129,4 +135,4 @@ func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string
|
||||
log.Errorf("Append message error, %s", err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user