From 7998b32080b4e22e81d79b6ea7b3f1af4d456f14 Mon Sep 17 00:00:00 2001 From: yuliang_guo Date: Thu, 29 Jan 2026 16:56:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=9D=E7=95=99=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E7=9A=84=20getUserStatistics=20=E5=92=8C=20g?= =?UTF-8?q?etRecentExams=20=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/dashboard.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/frontend/src/api/dashboard.ts b/frontend/src/api/dashboard.ts index b116279..d7f3831 100644 --- a/frontend/src/api/dashboard.ts +++ b/frontend/src/api/dashboard.ts @@ -1,8 +1,27 @@ /** - * 数据大屏 API + * 数据大屏 API 及首页统计 API */ import request from '@/api/request' +// ==================== 首页统计 API ==================== + +/** + * 获取用户统计数据(首页使用) + */ +export function getUserStatistics() { + return request.get('/api/v1/users/me/statistics') +} + +/** + * 获取最近考试列表(首页使用) + * @param limit 返回数量,默认5条 + */ +export function getRecentExams(limit: number = 5) { + return request.get('/api/v1/users/me/recent-exams', { limit }) +} + +// ==================== 数据大屏 API ==================== + // 数据概览 export interface DashboardOverview { overview: {