From e76d25816a9c4195e1edb53ca3c19b9d7c9a4082 Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Mon, 31 Mar 2025 18:01:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF=E7=9A=84?= =?UTF-8?q?=E7=AC=A6=E5=8F=B7=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/controller/DeviceQuery.java | 7 +++++-- web_src/src/components/StreamPushEdit.vue | 8 ++++---- .../src/components/common/CommonChannelEdit.vue | 16 ++++++++-------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/DeviceQuery.java b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/DeviceQuery.java index 33cfba080..80b4ba4de 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/DeviceQuery.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/DeviceQuery.java @@ -224,8 +224,11 @@ public class DeviceQuery { "UDP(udp传输),TCP-ACTIVE(tcp主动模式),TCP-PASSIVE(tcp被动模式)", required = true) @PostMapping("/transport/{deviceId}/{streamMode}") public void updateTransport(@PathVariable String deviceId, @PathVariable String streamMode){ + Assert.isTrue(streamMode.equalsIgnoreCase("UDP") + || streamMode.equalsIgnoreCase("TCP-ACTIVE") + || streamMode.equalsIgnoreCase("TCP-PASSIVE"), "数据流传输模式, 取值:UDP/TCP-ACTIVE/TCP-PASSIVE"); Device device = deviceService.getDeviceByDeviceId(deviceId); - device.setStreamMode(streamMode); + device.setStreamMode(streamMode.toUpperCase()); deviceService.updateCustomDevice(device); } @@ -233,7 +236,7 @@ public class DeviceQuery { @Operation(summary = "添加设备信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "device", description = "设备", required = true) @PostMapping("/device/add") - public void addDevice(Device device){ + public void addDevice(@RequestBody Device device){ if (device == null || device.getDeviceId() == null) { throw new ControllerException(ErrorCode.ERROR400); diff --git a/web_src/src/components/StreamPushEdit.vue b/web_src/src/components/StreamPushEdit.vue index 74c462453..4226b2658 100644 --- a/web_src/src/components/StreamPushEdit.vue +++ b/web_src/src/components/StreamPushEdit.vue @@ -86,9 +86,9 @@ export default { showClose: true, message: error }) - }).finally(()=>[ + }).finally(()=>{ this.locading = false - ]) + }) }else { this.$axios({ method: 'post', @@ -113,9 +113,9 @@ export default { showClose: true, message: error }) - }).finally(()=>[ + }).finally(()=>{ this.locading = false - ]) + }) } }, diff --git a/web_src/src/components/common/CommonChannelEdit.vue b/web_src/src/components/common/CommonChannelEdit.vue index b17abb8d4..ff6acee35 100644 --- a/web_src/src/components/common/CommonChannelEdit.vue +++ b/web_src/src/components/common/CommonChannelEdit.vue @@ -279,9 +279,9 @@ export default { showClose: true, message: error }); - }).finally(()=>[ + }).finally(()=>{ this.locading = false - ]) + }) }else { this.$axios({ method: 'post', @@ -308,9 +308,9 @@ export default { showClose: true, message: error }); - }).finally(()=>[ + }).finally(()=>{ this.locading = false - ]) + }) } }, @@ -338,9 +338,9 @@ export default { } }).catch((error) => { console.error(error) - }).finally(()=>[ + }).finally(()=>{ this.locading = false - ]) + }) }).catch(() => { }); @@ -363,9 +363,9 @@ export default { } }).catch((error) => { console.error(error) - }).finally(()=>[ + }).finally(()=>{ this.locading = false - ]) + }) }, buildDeviceIdCode: function (deviceId){