|
@@ -138,13 +138,19 @@ public class MktMgmtHandPushServiceImpl implements MktMgmtHandPushService {
|
|
|
|
|
|
for (String allowedIP : allowedIPs) {
|
|
|
if (allowedIP.contains("/")) {
|
|
|
- // IP段格式:192.168.10.101/192.168.10.110
|
|
|
+ // IP段格式:192.168.10.101/110
|
|
|
String[] ipRange = allowedIP.split("/");
|
|
|
if (ipRange.length == 2) {
|
|
|
String startIP = ipRange[0].trim();
|
|
|
- String endIP = ipRange[1].trim();
|
|
|
- if (isIPInRange(pushIP, startIP, endIP)) {
|
|
|
- return true;
|
|
|
+ String endIPPart = ipRange[1].trim();
|
|
|
+
|
|
|
+ // 构建结束IP:将最后一个数字替换为endIPPart
|
|
|
+ String[] startIPParts = startIP.split("\\.");
|
|
|
+ if (startIPParts.length == 4) {
|
|
|
+ String endIP = startIPParts[0] + "." + startIPParts[1] + "." + startIPParts[2] + "." + endIPPart;
|
|
|
+ if (isIPInRange(pushIP, startIP, endIP)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -242,6 +248,10 @@ public class MktMgmtHandPushServiceImpl implements MktMgmtHandPushService {
|
|
|
pushRecord.setPushContent(globalRule.getPushContent());
|
|
|
pushRecord.setAutoPush(1);
|
|
|
pushRecord.setPushStatus(true);
|
|
|
+ pushRecord.setPushFrequency(globalRule.getPushFrequency());
|
|
|
+ pushRecord.setPushType(globalRule.getPushType());
|
|
|
+ pushRecord.setPushAction(globalRule.getAction());
|
|
|
+ pushRecord.setDelayPush(Integer.valueOf(globalRule.getDelayPush()));
|
|
|
pushRecord.setCreateTime(LocalDateTime.now());
|
|
|
pushRecord.setUpdateTime(LocalDateTime.now());
|
|
|
|