接点赞前后端接口
Change-Id: Idd6c270c72fddc7c50412a4c54a7429d998ebb25
diff --git a/Merge/front/src/api/posts_api.js b/Merge/front/src/api/posts_api.js
index 06cf2c7..d42ede2 100644
--- a/Merge/front/src/api/posts_api.js
+++ b/Merge/front/src/api/posts_api.js
@@ -130,7 +130,14 @@
// 获取收藏列表
getFavorites: async (userId) => {
return await request(`${LJC_BASE_URL}/api/user/${userId}/favorites`)
- }
+ },
+
+ // 获取点赞状态
+ // GET /posts/:postId/like/status?user_id=123
+ hasLikedPost: async (postId, userId) => {
+ const url = `${WZY_BASE_URL}/posts/${postId}/like/status?user_id=${userId}`
+ return await request(url)
+ },
}
export default postsAPI