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] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8=E5=8C=B9?= =?UTF-8?q?=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 + } + } } + } }