mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-25 22:47:49 +08:00
修复前端布防撤防调用失败
This commit is contained in:
parent
d51de48923
commit
24417203f0
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* 设备控制命令API接口
|
* 设备控制命令API接口
|
||||||
*
|
*
|
||||||
* @author lawrencehj
|
* @author lawrencehj
|
||||||
* @date 2021年2月1日
|
* @date 2021年2月1日
|
||||||
*/
|
*/
|
||||||
@ -70,16 +70,16 @@ public class DeviceControl {
|
|||||||
|
|
||||||
@Operation(summary = "布防/撤防", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "布防/撤防", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||||
@Parameter(name = "guardCmdStr", description = "命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true)
|
@Parameter(name = "guardCmd", description = "命令, 可选值:SetGuard(布防),ResetGuard(撤防)", required = true)
|
||||||
@GetMapping("/guard")
|
@GetMapping("/guard")
|
||||||
public DeferredResult<WVPResult<String>> guardApi(String deviceId, String guardCmdStr) {
|
public DeferredResult<WVPResult<String>> guardApi(String deviceId, String guardCmd) {
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("布防/撤防API调用");
|
log.debug("布防/撤防API调用");
|
||||||
}
|
}
|
||||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||||
Assert.notNull(device, "设备不存在");
|
Assert.notNull(device, "设备不存在");
|
||||||
DeferredResult<WVPResult<String>> result = new DeferredResult<>();
|
DeferredResult<WVPResult<String>> result = new DeferredResult<>();
|
||||||
deviceService.guard(device, guardCmdStr, (code, msg, data) -> {
|
deviceService.guard(device, guardCmd, (code, msg, data) -> {
|
||||||
result.setResult(new WVPResult<>(code, msg, data));
|
result.setResult(new WVPResult<>(code, msg, data));
|
||||||
});
|
});
|
||||||
result.onTimeout(() -> {
|
result.onTimeout(() -> {
|
||||||
|
|||||||
@ -47,14 +47,22 @@ export function updateDeviceTransport(deviceId, streamMode) {
|
|||||||
export function setGuard(deviceId) {
|
export function setGuard(deviceId) {
|
||||||
return request({
|
return request({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `/api/device/control/guard/${deviceId}/SetGuard`
|
url: `/api/device/control/guard`,
|
||||||
|
params: {
|
||||||
|
deviceId: deviceId,
|
||||||
|
guardCmd: 'SetGuard'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetGuard(deviceId) {
|
export function resetGuard(deviceId) {
|
||||||
return request({
|
return request({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `/api/device/control/guard/${deviceId}/ResetGuard`
|
url: `/api/device/control/guard`,
|
||||||
|
params: {
|
||||||
|
deviceId: deviceId,
|
||||||
|
guardCmd: 'ResetGuard'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -362,7 +362,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
resetGuard: function(itemData) {
|
resetGuard: function(itemData) {
|
||||||
this.$store.dispatch('device/ResetGuard', itemData.deviceId)
|
this.$store.dispatch('device/resetGuard', itemData.deviceId)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
this.$message.success({
|
this.$message.success({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user