diff --git a/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java index bb86b314..8633cceb 100755 --- a/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java +++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java @@ -126,7 +126,7 @@ public class StreamProxyController { }) @PostMapping(value = "/update") @ResponseBody - public void update(@RequestBody StreamProxy param){ + public StreamProxy update(@RequestBody StreamProxy param){ log.info("更新代理: " + JSONObject.toJSONString(param)); if (param.getId() == 0) { throw new ControllerException(ErrorCode.ERROR400.getCode(), "缺少代理信息的ID"); @@ -135,6 +135,7 @@ public class StreamProxyController { param.setGbDeviceId(null); } streamProxyService.update(param); + return param; } @GetMapping(value = "/ffmpeg_cmd/list") @@ -170,7 +171,7 @@ public class StreamProxyController { @Operation(summary = "移除代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "id", description = "代理ID", required = true) public void delte(int id){ - log.info("移除代理: " + id ); + log.info("移除代理: {}", id); streamProxyService.delete(id); } @@ -179,7 +180,7 @@ public class StreamProxyController { @Operation(summary = "启用代理", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "id", description = "代理Id", required = true) public StreamContent start(int id){ - log.info("播放代理: " + id); + log.info("播放代理: {}", id); StreamInfo streamInfo = streamProxyService.start(id); if (streamInfo == null) { throw new ControllerException(ErrorCode.ERROR100.getCode(), ErrorCode.ERROR100.getMsg()); diff --git a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java index 1276c97b..8a14dfd7 100755 --- a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java @@ -161,9 +161,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService { streamProxy.setUpdateTime(DateUtil.getNow()); streamProxyMapper.add(streamProxy); streamProxy.setStreamProxyId(streamProxy.getId()); - if (streamProxy.isEnable()) { - return startProxy(streamProxy); - } return null; } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3f478442..b91ff2aa 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,4 +2,4 @@ spring: application: name: wvp profiles: - active: local \ No newline at end of file + active: 272重构 \ No newline at end of file diff --git a/web_src/src/components/StreamProxyEdit.vue b/web_src/src/components/StreamProxyEdit.vue index 11f322ca..a54bc28f 100644 --- a/web_src/src/components/StreamProxyEdit.vue +++ b/web_src/src/components/StreamProxyEdit.vue @@ -21,8 +21,8 @@ style="width: 100%" placeholder="请选择代理类型" > - - + + @@ -67,7 +67,7 @@ - + { this.$message.error(error); this.saveLoading = false; @@ -214,7 +221,7 @@ export default { }, noneReaderHandler: function() { console.log(this.streamProxy) - if (this.streamProxy.noneReader === null || this.streamProxy.noneReader === 0 || !this.streamProxy.noneReader) { + if (!this.streamProxy.noneReader || this.streamProxy.noneReader === 0 ) { this.streamProxy.enableDisableNoneReader = false; this.streamProxy.enableRemoveNoneReader = false; }else if (this.streamProxy.noneReader === 1){ diff --git a/web_src/src/components/StreamProxyList.vue b/web_src/src/components/StreamProxyList.vue index 0f587e7d..4a523bad 100755 --- a/web_src/src/components/StreamProxyList.vue +++ b/web_src/src/components/StreamProxyList.vue @@ -159,7 +159,12 @@ window.clearInterval(this.updateLooper) }, startUpdateList: function (){ - this.updateLooper = setInterval(this.getStreamProxyList, 1000); + this.updateLooper = setInterval(()=>{ + if (!this.streamProxy) { + this.getStreamProxyList() + } + + }, 1000); }, currentChange: function(val){ this.currentPage = val; @@ -238,6 +243,7 @@ this.$set(row, "noneReader", 0) } this.streamProxy = row + this.$set(this.streamProxy, "rtspType", row.rtspType) }, closeEdit: function(row){ this.streamProxy = null