From 91c9bc4fe329f7573f207eae07d9e30ae81141c6 Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Thu, 27 Mar 2025 17:13:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=8E=A5=E5=8F=A3=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E5=88=86=E9=9A=94=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/gb28181/controller/DeviceQuery.java | 8 ++++---- web_src/src/components/dialog/deviceEdit.vue | 4 ++-- 2 files changed, 6 insertions(+), 6 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 c18df8f59..33cfba080 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 @@ -79,7 +79,7 @@ public class DeviceQuery { @Parameter(name = "deviceId", description = "设备国标编号", required = true) @GetMapping("/devices/{deviceId}") public Device devices(@PathVariable String deviceId){ - + return deviceService.getDeviceByDeviceId(deviceId); } @@ -232,7 +232,7 @@ public class DeviceQuery { @Operation(summary = "添加设备信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "device", description = "设备", required = true) - @PostMapping("/device/add/") + @PostMapping("/device/add") public void addDevice(Device device){ if (device == null || device.getDeviceId() == null) { @@ -250,8 +250,8 @@ public class DeviceQuery { @Operation(summary = "更新设备信息", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "device", description = "设备", required = true) - @PostMapping("/device/update/") - public void updateDevice(Device device){ + @PostMapping("/device/update") + public void updateDevice(@RequestBody Device device){ if (device == null || device.getDeviceId() == null || device.getId() <= 0) { throw new ControllerException(ErrorCode.ERROR400); } diff --git a/web_src/src/components/dialog/deviceEdit.vue b/web_src/src/components/dialog/deviceEdit.vue index 860d9b734..1b0724efb 100755 --- a/web_src/src/components/dialog/deviceEdit.vue +++ b/web_src/src/components/dialog/deviceEdit.vue @@ -109,8 +109,8 @@ export default { console.log(this.form); this.$axios({ method: 'post', - url:`/api/device/query/device/${this.isEdit?'update':'add'}/`, - params: this.form + url:`/api/device/query/device/${this.isEdit?'update':'add'}`, + data: this.form }).then((res) => { console.log(res.data) if (res.data.code === 0) {