记录文章浏览量功能

This commit is contained in:
宇阳
2024-10-12 18:18:44 +08:00
parent 50b209dae2
commit 11e07ebabc
3 changed files with 11 additions and 3 deletions

View File

@@ -19,4 +19,9 @@ export const getRandomArticleListAPI = async () => {
// 获取推荐文章列表
export const getRecommendedArticleListAPI = async () => {
return await Request<Article[]>("GET", "/article/hot");
}
// 递增浏览量
export const recordViewAPI = async (id: number) => {
return await Request<void>("GET", `/article/view/${id}`);
}