diff --git a/frontend/mobile-upgrade/src/infrastructure/http/api-client.ts b/frontend/mobile-upgrade/src/infrastructure/http/api-client.ts index 4d977194..08899a58 100644 --- a/frontend/mobile-upgrade/src/infrastructure/http/api-client.ts +++ b/frontend/mobile-upgrade/src/infrastructure/http/api-client.ts @@ -79,7 +79,16 @@ export function createApiClient(appType: AppType = 'mobile'): AxiosInstance { }) client.interceptors.response.use( - (response) => response, + (response) => { + // mining-admin-service 的 TransformInterceptor 会将响应包装为 + // { success: true, data: , timestamp: "..." } + // 这里自动解包,使前端代码无需感知包装格式 + const body = response.data + if (body && typeof body === 'object' && !Array.isArray(body) && 'success' in body && 'data' in body) { + response.data = body.data + } + return response + }, (error: AxiosError) => { if (error.response) { const data = error.response.data as { message?: string }