敏感词修改代码结构
This commit is contained in:
@@ -19,6 +19,10 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
)
|
||||
|
||||
var (
|
||||
subSensitiveWordRegexp = regexp.MustCompile(`[^\[\]\"\}]`)
|
||||
)
|
||||
|
||||
func CreateStoreCategoryByStoreSku(ctx *jxcontext.Context, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs []int) (err error) {
|
||||
db := dao.GetDB()
|
||||
dao.Begin(db)
|
||||
@@ -587,11 +591,10 @@ func ClearRemoteStoreStuffAndSetNew(ctx *jxcontext.Context, parentTask tasksch.I
|
||||
}
|
||||
|
||||
func GetSensitiveWord(singleStoreHandler partner.ISingleStoreStoreSkuHandler, str string) string {
|
||||
var regFindKeyWord = singleStoreHandler.GetSensitiveWordRegexp()
|
||||
var subRegFindKeyWord = regexp.MustCompile(`[^\[\]\"\}]`)
|
||||
findResult := regFindKeyWord.FindStringSubmatch(str)
|
||||
sensitiveWordRegexp := singleStoreHandler.GetSensitiveWordRegexp()
|
||||
findResult := sensitiveWordRegexp.FindStringSubmatch(str)
|
||||
if findResult != nil && len(findResult) > 1 {
|
||||
findSubResult := subRegFindKeyWord.FindAllString(findResult[1], -1)
|
||||
findSubResult := subSensitiveWordRegexp.FindAllString(findResult[1], -1)
|
||||
return strings.Join(findSubResult, "")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user