|
@@ -848,6 +848,12 @@ public class CommunityArticleController extends BaseController {
|
|
|
if (Objects.isNull(likeUserId)) {
|
|
|
return AjaxResult.error("参数失效!");
|
|
|
}
|
|
|
+ //无法关注自己
|
|
|
+ Long userId = SecurityUtils.getLoginUser().getUserId();
|
|
|
+ if (userId.equals(likeUserId)) {
|
|
|
+ return AjaxResult.error("无法关注自己!");
|
|
|
+ }
|
|
|
+
|
|
|
String msg = "";
|
|
|
CommunityUserLike communityUserLike = communityArticleService.addOrDeleteUserLike(likeUserId);
|
|
|
try {
|