前端封装是否点赞的api
Change-Id: I69e915f6c9aa1a8f721ff38a4df58dd8fdfc6e0a
diff --git a/Merge/front/src/api/search_jwlll.js b/Merge/front/src/api/search_jwlll.js
index 01b743f..e18efa3 100644
--- a/Merge/front/src/api/search_jwlll.js
+++ b/Merge/front/src/api/search_jwlll.js
@@ -79,6 +79,17 @@
})
},
+ // 查看是否点赞
+ hasLiked: async (postId, userId) => {
+ const res = await request(
+ `${WZY_BASE_URL}/posts/${postId}/like?user_id=${userId}`,
+ {
+ method: 'GET'
+ }
+ )
+ return res.liked
+ },
+
// 添加评论
addComment: async (postId, userId, content) => {
return await request(`${WZY_BASE_URL}/posts/${postId}/comments`, {