From 8512e0aeb54d149665e754897c7a207bb24c222b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Sun, 8 Dec 2024 14:18:01 +0800 Subject: [PATCH] =?UTF-8?q?debug:=E5=90=88=E4=BC=99=E4=BA=BA=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/ss/device/service/impl/DeviceValidatorImpl.java | 2 +- .../java/com/ruoyi/web/controller/app/AppDeviceController.java | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) 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());