🎨 删除无效代码

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

View File

@ -242,13 +242,10 @@ 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()); Article article = articleMapper.selectByPrimaryKey(id);
if (roleWeights > ADMIN_ROLE_WEIGHTS) { if (!user.getIdUser().equals(article.getArticleAuthorId())) {
Article article = articleMapper.selectByPrimaryKey(id); map.put("message", "非法访问!");
if (!user.getIdUser().equals(article.getArticleAuthorId())) { return map;
map.put("message", "非法访问!");
return map;
}
} }
int result; int result;
// 判断是否有评论 // 判断是否有评论