本地忽略敏感字服务器
parent
c24fe5768c
commit
fa8b30a0ad
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
|
@ -43,10 +44,13 @@ public class SensitivewordFilter {
|
|||
*
|
||||
* @param txt 文字
|
||||
* @param matchType 匹配规则 1:最小匹配规则,2:最大匹配规则
|
||||
* @return
|
||||
* @return 返回是敏感字的字符
|
||||
* @version 1.0
|
||||
*/
|
||||
private static Set<String> getSensitiveWord(String txt, int matchType) {
|
||||
if (GameApplication.serverProperties.isDebug()){
|
||||
return new HashSet<>();
|
||||
}
|
||||
Object o = RedisUtil.getInstence().get(SENSIT_WORD_FILTER_KEY);
|
||||
if (o == null) {
|
||||
LOGGER.info("getSensitiveWord 敏感字检测服未开启");
|
||||
|
@ -115,11 +119,15 @@ public class SensitivewordFilter {
|
|||
}
|
||||
|
||||
/**
|
||||
* 检查文字中是否包含敏感字符,检查规则如下:<br>
|
||||
* 检查文字中是否包含敏感字符,检查规则如下
|
||||
* 包含返回true,不包含返回false
|
||||
* @return,如果存在,则返回敏感词字符的长度,不存在返回0
|
||||
* @version 1.0
|
||||
*/
|
||||
private static boolean isContaintSensitiveWordThrift(String userName, int type) throws ErrorCodeException {
|
||||
if (GameApplication.serverProperties.isDebug()){
|
||||
return false;
|
||||
}
|
||||
Object o = RedisUtil.getInstence().get(SENSIT_WORD_FILTER_KEY);
|
||||
if (o == null) {
|
||||
LOGGER.error("getSensitiveWord 敏感字检测服未开启");
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.ljsd.jieling.util;
|
||||
|
||||
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import org.slf4j.Logger;
|
||||
|
|
Loading…
Reference in New Issue