1
0

marge: 合并代码

This commit is contained in:
TsMask
2023-11-01 19:20:18 +08:00
parent f8bf36f94b
commit 970167c76c
15 changed files with 105 additions and 60 deletions

View File

@@ -34,6 +34,13 @@ func LogOperate(options collectlogs.Options) func(http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
startTime := time.Now()
// 只对前端发送的数据进行记录
appCodeStr := r.Header.Get("X-App-Code")
if appCodeStr == "" {
next.ServeHTTP(w, r)
return
}
// 函数名
funcName := runtime.FuncForPC(reflect.ValueOf(next).Pointer()).Name()
lastDotIndex := strings.LastIndex(funcName, "/")