From 8b09370cf2e69f643cde6bb7cc984b4f7c0a4be4 Mon Sep 17 00:00:00 2001 From: ronger Date: Mon, 3 Jan 2022 19:22:47 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=88=A0=E9=99=A4=E6=97=A0=E6=95=88?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rymcu/forest/service/impl/ArticleServiceImpl.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/rymcu/forest/service/impl/ArticleServiceImpl.java b/src/main/java/com/rymcu/forest/service/impl/ArticleServiceImpl.java index 970bbf6..10d344a 100644 --- a/src/main/java/com/rymcu/forest/service/impl/ArticleServiceImpl.java +++ b/src/main/java/com/rymcu/forest/service/impl/ArticleServiceImpl.java @@ -242,13 +242,10 @@ public class ArticleServiceImpl extends AbstractService
implements Arti if (Objects.isNull(user)) { throw new BaseApiException(ErrorCode.INVALID_TOKEN); } - Integer roleWeights = userService.findRoleWeightsByUser(user.getIdUser()); - if (roleWeights > ADMIN_ROLE_WEIGHTS) { - Article article = articleMapper.selectByPrimaryKey(id); - if (!user.getIdUser().equals(article.getArticleAuthorId())) { - map.put("message", "非法访问!"); - return map; - } + Article article = articleMapper.selectByPrimaryKey(id); + if (!user.getIdUser().equals(article.getArticleAuthorId())) { + map.put("message", "非法访问!"); + return map; } int result; // 判断是否有评论