From c1f2a17ed0760c7261145c4f6d25f1cc19cabc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B3=E5=87=A1=E6=A2=A6?= Date: Mon, 13 Jul 2020 17:35:14 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=20=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index fa9b01c8b..69facc028 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -731,10 +731,23 @@ func IsSensitiveWordInList(str string) (bool, string) { if err == nil { for _, value := range wordList { keyWord := value.Word - checkHas := strings.Contains(keyWord, str) - if checkHas { - return true, str + if value.VendorID != -2 { + checkHas := strings.Contains(str, keyWord) + if checkHas { + return true, keyWord + } + } else { + var index int + for index > 0 { + index = strings.Index(keyWord, ",") + keyWord = keyWord[index+1:] + checkHas := strings.Contains(keyWord, str) + if checkHas { + return true, str + } + } } + } } From 4cc4ddaeff69b4ff13aecaec7386149cc0c9c1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B3=E5=87=A1=E6=A2=A6?= Date: Mon, 13 Jul 2020 17:37:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=20=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 69facc028..d3d5ed135 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -741,9 +741,9 @@ func IsSensitiveWordInList(str string) (bool, string) { for index > 0 { index = strings.Index(keyWord, ",") keyWord = keyWord[index+1:] - checkHas := strings.Contains(keyWord, str) + checkHas := strings.Contains(str, keyWord) if checkHas { - return true, str + return true, keyWord } } } From faed02bbee3b038296b0de4fb07714b9a4ca2327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B3=E5=87=A1=E6=A2=A6?= Date: Mon, 13 Jul 2020 17:38:28 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=20=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index d3d5ed135..2a88d7dc7 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -740,7 +740,7 @@ func IsSensitiveWordInList(str string) (bool, string) { var index int for index > 0 { index = strings.Index(keyWord, ",") - keyWord = keyWord[index+1:] + keyWord = keyWord[:index-1] checkHas := strings.Contains(str, keyWord) if checkHas { return true, keyWord From 72a0e791b93e41996d5f315fa5e321fca4dcfe23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B9=B3=E5=87=A1=E6=A2=A6?= Date: Mon, 13 Jul 2020 17:39:08 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=20=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 1 + 1 file changed, 1 insertion(+) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 2a88d7dc7..3d8ae2d33 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -741,6 +741,7 @@ func IsSensitiveWordInList(str string) (bool, string) { for index > 0 { index = strings.Index(keyWord, ",") keyWord = keyWord[:index-1] + globals.SugarLogger.Debug("keyWord", keyWord) checkHas := strings.Contains(str, keyWord) if checkHas { return true, keyWord