修复:来源字段筛选超时与重复扫描

This commit is contained in:
2026-11-13 16:52:27 +08:00
parent 5457f5c786
commit ea84e26b2f
7 changed files with 89 additions and 43 deletions
+4 -1
View File
@@ -122,7 +122,10 @@ export async function request<T>(path: string, init: RequestInit = {}, timeoutMs
}
catch (error) {
handleAccessFailure(error);
if (error instanceof Error && error.name === 'RequestTimeoutError') throw new ApiError(408, '连接质量数据服务超时,请点击重新连接;服务恢复后可继续使用。');
if (error instanceof Error && error.name === 'RequestTimeoutError') {
const query = /^\/api\/(?:metrics(?:\/|$)|records(?:\/|$)|analysis\/(?:source\/|defects(?:\/|$)))/.test(requestPath(path));
throw new ApiError(408, query ? '查询处理超时,请重试或调整筛选范围。' : '连接质量数据服务超时,请点击重新连接;服务恢复后可继续使用。');
}
throw error;
}
}