Skip to content

Commit 3d5d637

Browse files
author
CodeJudge
committed
fix: 随机/未做API返回值匹配 + 超时状态过滤条件修复
1 parent 4575a1b commit 3d5d637

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

frontend/src/pages/Submissions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const STATUS_FILTERS = [
2828
{ label: '通过', value: 'accepted' },
2929
{ label: '答案错误', value: 'wrong_answer' },
3030
{ label: '运行错误', value: 'runtime_error' },
31-
{ label: '超时', value: 'time_limit_exceeded' },
31+
{ label: '超时', value: 'time_limit' },
3232
];
3333

3434
const LANGUAGE_FILTERS = [

frontend/src/services/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ const api = {
6060
getAdminStats: () => request<import('../types').AdminStats>('/problems/admin/stats'),
6161
getTags: () => request<{ tags: { name: string; count: number }[] }>('/problems/tags'),
6262
getDaily: () => request<{ problem: import('../types').Problem; date: string }>('/problems/daily'),
63-
random: (type?: string) => request<import('../types').Problem>(`/problems/random${type ? `?type=${type}` : ''}`),
64-
randomUnsolved: () => request<import('../types').Problem>('/problems/random-unsolved'),
63+
random: (type?: string) => request<{ problem: import('../types').Problem }>(`/problems/random${type ? `?type=${type}` : ''}`).then(r => r.problem),
64+
randomUnsolved: () => request<{ problem: import('../types').Problem }>('/problems/random-unsolved').then(r => r.problem),
6565
},
6666

6767
submissions: {

0 commit comments

Comments
 (0)