Files
digital-pilates/services/recommendations.ts
richarjiang 5d09cc05dc feat: 更新文章功能和相关依赖
- 新增文章详情页面,支持根据文章 ID 加载和展示文章内容
- 添加文章卡片组件,展示推荐文章的标题、封面和阅读量
- 更新文章服务,支持获取文章列表和根据 ID 获取文章详情
- 集成腾讯云 COS SDK,支持文件上传功能
- 优化打卡功能,支持按日期加载和展示打卡记录
- 更新相关依赖,确保项目兼容性和功能完整性
- 调整样式以适应新功能的展示和交互
2025-08-14 16:03:19 +08:00

24 lines
544 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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`);
}