mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
敏感词工具类SensitiveUtil支持自定义字符过滤规则
This commit is contained in:
parent
f1ea1da90f
commit
bc5028d6c3
@ -84,6 +84,15 @@ public final class SensitiveUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否包含敏感词
|
||||
* @param text 文本
|
||||
* @return 是否包含
|
||||
*/
|
||||
public static boolean containsSensitive(String text){
|
||||
return sensitiveTree.isMatch(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否包含敏感词
|
||||
* @param obj bean,会被转为JSON字符串
|
||||
|
Loading…
Reference in New Issue
Block a user