marge: 合并代码

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

No files matched your search

+7
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, "/")