|
@@ -95,6 +95,8 @@ namespace Hotline.Api.Controllers
|
|
|
var model = await _systemAreaDomainService.GetArea(dto.Id,HttpContext.RequestAborted);
|
|
|
if (model is null)
|
|
|
throw UserFriendlyException.SameMessage("未知数据,请刷新页面");
|
|
|
+ if (!model.IsCanModify)
|
|
|
+ throw UserFriendlyException.SameMessage("系统数据,不能修改");
|
|
|
|
|
|
model = _mapper.Map<SystemArea>(dto);
|
|
|
await _systemAreaDomainService.ModifyArea(model, HttpContext.RequestAborted);
|
|
@@ -112,6 +114,8 @@ namespace Hotline.Api.Controllers
|
|
|
var model = await _systemAreaDomainService.GetArea(id, HttpContext.RequestAborted);
|
|
|
if (model is null)
|
|
|
throw UserFriendlyException.SameMessage("未知数据,请刷新页面");
|
|
|
+ if (!model.IsCanModify)
|
|
|
+ throw UserFriendlyException.SameMessage("系统数据不能删除");
|
|
|
|
|
|
await _systemAreaDomainService.DelArea(id, HttpContext.RequestAborted);
|
|
|
}
|