From bc6ae4858876937b904ac2bbde2b053124f9e7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sun, 24 Dec 2023 21:50:30 +0800 Subject: [PATCH] =?UTF-8?q?:bug:fix=E6=9F=A5=E7=9C=8B=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=96=87=E7=AB=A0=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/Article/ArticleController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ZR.Admin.WebApi/Controllers/Article/ArticleController.cs b/ZR.Admin.WebApi/Controllers/Article/ArticleController.cs index b8719bc..b295790 100644 --- a/ZR.Admin.WebApi/Controllers/Article/ArticleController.cs +++ b/ZR.Admin.WebApi/Controllers/Article/ArticleController.cs @@ -85,6 +85,7 @@ namespace ZR.Admin.WebApi.Controllers long userId = HttpContext.GetUId(); var response = _ArticleService.GetId(id); var model = response.Adapt(); + if (model == null) return ToResponse(ResultCode.FAIL, "文章不存在"); if (model.IsPublic == 0 && userId != model.UserId) { return ToResponse(ResultCode.CUSTOM_ERROR, "访问失败");