去掉操作日志中的token
This commit is contained in:
@@ -2,6 +2,7 @@ package event
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -21,6 +22,7 @@ var (
|
||||
"CreateQrOrBarCode": "CreateQrOrBarCode",
|
||||
"StatisticsReportForOrders": "StatisticsReportForOrders",
|
||||
}
|
||||
regexpToken = regexp.MustCompile(`,"token":".*"`)
|
||||
)
|
||||
|
||||
type CheckCookie struct {
|
||||
@@ -46,6 +48,7 @@ func AddOperateEvent(ctx *jxcontext.Context, accessUUID, jsonData string, errCod
|
||||
if accessUUID != "" {
|
||||
accessUUID = accessUUID[0:strings.Index(accessUUID, ",")]
|
||||
}
|
||||
jsonData = strings.ReplaceAll(jsonData, regexpToken.FindString(jsonData), "")
|
||||
jsonData = utils.LimitUTF8StringLen(jsonData, 3200)
|
||||
event := &model.OperateEvent{
|
||||
CreatedAt: time.Now(),
|
||||
|
||||
Reference in New Issue
Block a user