feat: 更新文章功能和相关依赖

- 新增文章详情页面,支持根据文章 ID 加载和展示文章内容
- 添加文章卡片组件,展示推荐文章的标题、封面和阅读量
- 更新文章服务,支持获取文章列表和根据 ID 获取文章详情
- 集成腾讯云 COS SDK,支持文件上传功能
- 优化打卡功能,支持按日期加载和展示打卡记录
- 更新相关依赖,确保项目兼容性和功能完整性
- 调整样式以适应新功能的展示和交互
This commit is contained in:
richarjiang
2025-08-14 16:03:19 +08:00
parent 532cf251e2
commit 5d09cc05dc
24 changed files with 1953 additions and 513 deletions

View File

@@ -0,0 +1,23 @@
import { api } from '@/services/api';
export enum RecommendationType {
Article = 'article',
Checkin = 'checkin',
}
export type RecommendationCard = {
id: string;
type: RecommendationType;
title?: string;
coverUrl: string;
articleId?: string;
subtitle?: string;
extra?: Record<string, any>;
};
export async function fetchRecommendations(): Promise<RecommendationCard[]> {
// 后端返回 BaseResponseDto<data>services/api 会自动解出 data 字段
return api.get<RecommendationCard[]>(`/recommendations/list`);
}