debug:合伙人设备权限

This commit is contained in:
磷叶 2024-12-08 14:18:01 +08:00
parent 02be2303ca
commit 8512e0aeb5
2 changed files with 1 additions and 4 deletions

View File

@ -294,7 +294,7 @@ public class DeviceValidatorImpl extends BaseValidator implements DeviceValidato
return false; return false;
} }
DeviceVO device = deviceService.selectById(deviceId); DeviceVO device = deviceService.selectById(deviceId);
return isMch(device, userId); return canOpera(device, userId);
} }
@Override @Override

View File

@ -188,9 +188,6 @@ public class AppDeviceController extends BaseController {
@ApiParam("单位") @RequestParam(required = false, defaultValue = "3") String timeUnit, @ApiParam("单位") @RequestParam(required = false, defaultValue = "3") String timeUnit,
@ApiParam("是否操作物联网设备") @RequestParam(required = false, defaultValue = "true") Boolean withIot @ApiParam("是否操作物联网设备") @RequestParam(required = false, defaultValue = "true") Boolean withIot
) { ) {
if (!deviceValidator.canOpera(deviceId, getUserId()) ) {
return error("您无权操作此设备");
}
DeviceVO device = smDeviceService.selectById(deviceId); DeviceVO device = smDeviceService.selectById(deviceId);
ServiceUtil.assertion(device == null, "设备不存在"); ServiceUtil.assertion(device == null, "设备不存在");
deviceAssembler.assembleAllowSwitch(device, getUserId()); deviceAssembler.assembleAllowSwitch(device, getUserId());