🐛fix查看文章详情文章不存在报错
This commit is contained in:
parent
2a3d8bab6c
commit
bc6ae48588
@ -85,6 +85,7 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
long userId = HttpContext.GetUId();
|
long userId = HttpContext.GetUId();
|
||||||
var response = _ArticleService.GetId(id);
|
var response = _ArticleService.GetId(id);
|
||||||
var model = response.Adapt<ArticleDto>();
|
var model = response.Adapt<ArticleDto>();
|
||||||
|
if (model == null) return ToResponse(ResultCode.FAIL, "文章不存在");
|
||||||
if (model.IsPublic == 0 && userId != model.UserId)
|
if (model.IsPublic == 0 && userId != model.UserId)
|
||||||
{
|
{
|
||||||
return ToResponse(ResultCode.CUSTOM_ERROR, "访问失败");
|
return ToResponse(ResultCode.CUSTOM_ERROR, "访问失败");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user