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; // 判断是否有评论