管理员
This commit is contained in:
@ -169,9 +169,13 @@ public class DeviceTypeServiceImpl extends ServiceImpl<DeviceTypeMapper, DeviceT
|
|||||||
throw new RuntimeException("设备类型名称已存在,无法修改!!!");
|
throw new RuntimeException("设备类型名称已存在,无法修改!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 管理员
|
||||||
|
String username = LoginHelper.getUsername();
|
||||||
|
if (!username.equals("admin")) {
|
||||||
if (!Objects.equals(deviceType.getCustomerId(), LoginHelper.getUserId())) {
|
if (!Objects.equals(deviceType.getCustomerId(), LoginHelper.getUserId())) {
|
||||||
throw new RuntimeException("无权修改该设备类型");
|
throw new RuntimeException("无权修改该设备类型");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BeanUtil.copyProperties(resources, deviceType);
|
BeanUtil.copyProperties(resources, deviceType);
|
||||||
deviceTypeMapper.updateById(deviceType);
|
deviceTypeMapper.updateById(deviceType);
|
||||||
|
Reference in New Issue
Block a user