🎨 删除无效代码

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)) { if (Objects.isNull(user)) {
throw new BaseApiException(ErrorCode.INVALID_TOKEN); throw new BaseApiException(ErrorCode.INVALID_TOKEN);
} }
Integer roleWeights = userService.findRoleWeightsByUser(user.getIdUser());
if (roleWeights > ADMIN_ROLE_WEIGHTS) {
Article article = articleMapper.selectByPrimaryKey(id); Article article = articleMapper.selectByPrimaryKey(id);
if (!user.getIdUser().equals(article.getArticleAuthorId())) { if (!user.getIdUser().equals(article.getArticleAuthorId())) {
map.put("message", "非法访问!"); map.put("message", "非法访问!");
return map; return map;
} }
}
int result; int result;
// 判断是否有评论 // 判断是否有评论
boolean isHavComment = articleMapper.existsCommentWithPrimaryKey(id); boolean isHavComment = articleMapper.existsCommentWithPrimaryKey(id);