From 42a2772d1aa7493bcc4fac3e24ee8eda4eebc23d Mon Sep 17 00:00:00 2001 From: xubinbin <1323875150@qq.com> Date: 星期二, 12 十二月 2023 17:09:04 +0800 Subject: [PATCH] bugfix:请求头带token, SecurityUtils 获取用户id 一直为0 #1195 --- src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java index fe535bf..20ed8cb 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java @@ -6,6 +6,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; import org.springframework.util.ObjectUtils; import java.net.InetAddress; @@ -14,6 +15,7 @@ @Configuration("mediaConfig") +@Order(0) public class MediaConfig{ private final static Logger logger = LoggerFactory.getLogger(MediaConfig.class); @@ -72,6 +74,9 @@ @Value("${media.rtp.port-range}") private String rtpPortRange; + + @Value("${media.rtp.send-port-range}") + private String rtpSendPortRange; @Value("${media.record-assist-port:0}") private Integer recordAssistPort = 0; @@ -204,6 +209,7 @@ mediaServerItem.setSecret(secret); mediaServerItem.setRtpEnable(rtpEnable); mediaServerItem.setRtpPortRange(rtpPortRange); + mediaServerItem.setSendRtpPortRange(rtpSendPortRange); mediaServerItem.setRecordAssistPort(recordAssistPort); mediaServerItem.setHookAliveInterval(30.00f); @@ -213,11 +219,18 @@ return mediaServerItem; } + public String getRtpSendPortRange() { + return rtpSendPortRange; + } + + public void setRtpSendPortRange(String rtpSendPortRange) { + this.rtpSendPortRange = rtpSendPortRange; + } + private boolean isValidIPAddress(String ipAddress) { if ((ipAddress != null) && (!ipAddress.isEmpty())) { return Pattern.matches("^([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}$", ipAddress); } return false; } - } -- Gitblit v1.8.0