diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/DeviceValidatorImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/DeviceValidatorImpl.java index 339c6833..a5f45a49 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/DeviceValidatorImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/DeviceValidatorImpl.java @@ -294,7 +294,7 @@ public class DeviceValidatorImpl extends BaseValidator implements DeviceValidato return false; } DeviceVO device = deviceService.selectById(deviceId); - return isMch(device, userId); + return canOpera(device, userId); } @Override diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDeviceController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDeviceController.java index a60351f0..eee4a2d3 100644 --- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDeviceController.java +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDeviceController.java @@ -188,9 +188,6 @@ public class AppDeviceController extends BaseController { @ApiParam("单位") @RequestParam(required = false, defaultValue = "3") String timeUnit, @ApiParam("是否操作物联网设备") @RequestParam(required = false, defaultValue = "true") Boolean withIot ) { - if (!deviceValidator.canOpera(deviceId, getUserId()) ) { - return error("您无权操作此设备"); - } DeviceVO device = smDeviceService.selectById(deviceId); ServiceUtil.assertion(device == null, "设备不存在"); deviceAssembler.assembleAllowSwitch(device, getUserId());