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