fix: Fix the issue of abnormal parsing of Chinese nodes (#8790)

This commit is contained in:
ssongliu 2025-05-23 14:46:15 +08:00 committed by GitHub
parent fe6c2a2c76
commit 38a668fbeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,6 +7,7 @@ import (
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"net/url"
"path" "path"
"reflect" "reflect"
"strings" "strings"
@ -32,7 +33,8 @@ func OperationLog() gin.HandlerFunc {
source := loadLogInfo(c.Request.URL.Path) source := loadLogInfo(c.Request.URL.Path)
pathItem := strings.TrimPrefix(c.Request.URL.Path, "/api/v2") pathItem := strings.TrimPrefix(c.Request.URL.Path, "/api/v2")
pathItem = strings.TrimPrefix(pathItem, "/api/v2/core") pathItem = strings.TrimPrefix(pathItem, "/api/v2/core")
currentNode := c.Request.Header.Get("CurrentNode") currentNodeItem := c.Request.Header.Get("CurrentNode")
currentNode, _ := url.QueryUnescape(currentNodeItem)
record := &model.OperationLog{ record := &model.OperationLog{
Source: source, Source: source,
Node: currentNode, Node: currentNode,