管理员

This commit is contained in:
2025-08-21 17:55:59 +08:00
parent e9542c70e9
commit 9dee7ad102

View File

@ -169,8 +169,12 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
throw new RuntimeException("设备类型名称已存在,无法修改!!!"); throw new RuntimeException("设备类型名称已存在,无法修改!!!");
} }
if (!Objects.equals(deviceType.getCustomerId(), LoginHelper.getUserId())) { // 管理员
throw new RuntimeException("无权修改该设备类型"); String username = LoginHelper.getUsername();
if (!username.equals("admin")) {
if (!Objects.equals(deviceType.getCustomerId(), LoginHelper.getUserId())) {
throw new RuntimeException("无权修改该设备类型");
}
} }
BeanUtil.copyProperties(resources, deviceType); BeanUtil.copyProperties(resources, deviceType);