修改自动匹配 方法

This commit is contained in:
平凡梦
2020-07-13 17:35:14 +08:00
parent 84e41455f8
commit c1f2a17ed0

View File

@@ -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
}
}
}
}
}