diff --git a/ruoyi-web/src/main/java/com/ruoyi/web/bst/DeviceIotController.java b/ruoyi-web/src/main/java/com/ruoyi/web/bst/DeviceIotController.java index 2a2c5ba..8339b14 100644 --- a/ruoyi-web/src/main/java/com/ruoyi/web/bst/DeviceIotController.java +++ b/ruoyi-web/src/main/java/com/ruoyi/web/bst/DeviceIotController.java @@ -35,10 +35,10 @@ public class DeviceIotController extends BaseController { private DeviceVO getDevice(Long id, String sn) { if (id != null) { - ServiceUtil.assertion(deviceValidator.canOperate(id), "您无权限操作ID为%s的设备", id); + ServiceUtil.assertion(!deviceValidator.canOperate(id), "您无权限操作ID为%s的设备", id); return deviceService.selectDeviceById(id, true); } else if (sn != null) { - ServiceUtil.assertion(deviceValidator.canOperate(sn), "您无权限操作SN为%s的设备", sn); + ServiceUtil.assertion(!deviceValidator.canOperate(sn), "您无权限操作SN为%s的设备", sn); return deviceService.selectDeviceBySn(sn, true); } else { throw new ServiceException("SN和ID不能同时为空");