🎨 删除无效代码

This commit is contained in:
ronger 2022-01-03 19:22:47 +08:00
parent 6a1bd7869a
commit 8b09370cf2

View File

@ -242,14 +242,11 @@ public class ArticleServiceImpl extends AbstractService<Article> 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;
}
}
int result;
// 判断是否有评论
boolean isHavComment = articleMapper.existsCommentWithPrimaryKey(id);