feat: stabilize document type and upload flows

This commit is contained in:
wren
2026-04-30 17:44:05 +08:00
parent 81c5e98b53
commit 3fb7e9f5d0
18 changed files with 2122 additions and 491 deletions
+12 -2
View File
@@ -4,6 +4,12 @@
import axios from 'axios';
import { API_BASE_URL } from '../config/api-config';
interface ApiResult<T> {
code: number;
message: string;
data: T | null;
}
/**
* 队列状态响应接口
*/
@@ -43,12 +49,16 @@ export async function getQueueStatus(): Promise<{ data?: QueueStatus; error?: st
headers['Authorization'] = `Bearer ${token}`;
}
const response = await axios.get<QueueStatus>(
const response = await axios.get<ApiResult<QueueStatus>>(
`${API_BASE_URL}/api/v2/system/queue/status`,
{ headers }
);
return { data: response.data };
if (response.data?.data) {
return { data: response.data.data };
}
return { error: response.data?.message || '队列状态响应格式错误' };
} catch (error) {
// 队列接口暂未迁移,404 时返回空状态不报错
if (axios.isAxiosError(error) && error.response?.status === 404) {