白名单判断优化

This commit is contained in:
feng.li
2024-01-23 16:47:43 +08:00
parent 5c2f83d92f
commit 6c3821d53e

View File

@@ -59,7 +59,7 @@ public class EventCenterHttpRequest {
@Value("${hsay.event.systemsource:null}")
private String source;
@Value("#{'${sms.whiteList:null}'.split(',')}")
@Value("#{'${sms.whiteList:,}'.split(',')}")
private List<String> whiteList;
/**
@@ -135,7 +135,8 @@ public class EventCenterHttpRequest {
public void sendSmsVariable(String phone, SMSMsgEnum smsMsgEnum, String... objects) throws ApiException {
//为避免对真实线索造成困扰和便于测试,测试环境只给白名单手机号发短信
if (whiteList == null || !whiteList.contains(phone)) {
//由于做了解析whiteList 一定不是 bull生产环境不配置该配置会为一个空 List
if (!whiteList.isEmpty() && !whiteList.contains(phone)) {
return;
}