mirror of
https://gitee.com/beecue/fastbee.git
synced 2026-11-06 17:09:11 +08:00
fix(视频SIP): 产品无独立配置时回落默认SIP配置
打开国标产品SIP配置页时,若该产品在 sip_config 无记录则回落到后端默认 (sip.*)配置预填;修正 GetDefaultSipConfig 误将 null 写入缓存的问题。
This commit is contained in:
@@ -51,13 +51,20 @@ public class SipConfigServiceImpl implements ISipConfigService {
|
||||
Object temp = redisCache.getCacheObject(FastBeeConstant.REDIS.DEFAULT_SIP_CONFIG);
|
||||
SipConfig sipConfig = new SipConfig();
|
||||
if (temp == null) {
|
||||
SysSipConfig defConfig = new SysSipConfig();
|
||||
defConfig.setEnabled(sysSipConfig.isEnabled());
|
||||
defConfig.setIp(sysSipConfig.getIp());
|
||||
defConfig.setPort(sysSipConfig.getPort());
|
||||
defConfig.setDomain(sysSipConfig.getDomain());
|
||||
defConfig.setId(sysSipConfig.getId());
|
||||
defConfig.setPassword(sysSipConfig.getPassword());
|
||||
redisCache.setCacheObject(FastBeeConstant.REDIS.DEFAULT_SIP_CONFIG, defConfig);
|
||||
sipConfig.setEnabled(sysSipConfig.isEnabled() ? 1 : 0);
|
||||
sipConfig.setIp(sysSipConfig.getIp());
|
||||
sipConfig.setPort(sysSipConfig.getPort());
|
||||
sipConfig.setDomain(sysSipConfig.getDomain());
|
||||
sipConfig.setServerSipid(sysSipConfig.getId());
|
||||
sipConfig.setPassword(sysSipConfig.getPassword());
|
||||
redisCache.setCacheObject(FastBeeConstant.REDIS.DEFAULT_SIP_CONFIG, temp);
|
||||
} else if (temp instanceof SipConfig){
|
||||
sipConfig = (SipConfig) temp;
|
||||
updateDefaultSipConfig((SipConfig) temp);
|
||||
|
||||
@@ -121,10 +121,23 @@ export default {
|
||||
created() {
|
||||
this.productInfo = this.product;
|
||||
if (this.productInfo && this.productInfo.productId != 0) {
|
||||
this.getSipconfig(false);
|
||||
this.loadSipconfig();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 加载产品SIP配置:没有独立配置时回落到后端默认(sip.*)配置预填 */
|
||||
loadSipconfig() {
|
||||
getSipconfig(this.productInfo.productId, false).then(response => {
|
||||
if (response.data) {
|
||||
this.form = response.data;
|
||||
return;
|
||||
}
|
||||
// 该产品还没有独立配置,取默认配置预填,由用户确认后保存
|
||||
getSipconfig(this.productInfo.productId, true).then(res => {
|
||||
this.form = res.data || {};
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 获取产品下第一条SIP配置 */
|
||||
getSipconfig(isDefault) {
|
||||
getSipconfig(this.productInfo.productId, isDefault).then(response => {
|
||||
|
||||
Reference in New Issue
Block a user