删除所有console.log输出,优化评查结果的表格的显示,添加新的页码获取逻辑

This commit is contained in:
2025-06-02 18:55:00 +08:00
parent 820baa5b22
commit b02978508d
71 changed files with 862 additions and 572 deletions
+6 -6
View File
@@ -90,7 +90,7 @@ const fetchWithTimeout = async (url: string, options: RequestInit, timeout = 500
const id = setTimeout(() => controller.abort(), timeout);
try {
console.log(`📦 client.ts->请求URL: ${decodeUrlForDisplay(url)}`);
// console.log(`📦 client.ts->请求URL: ${decodeUrlForDisplay(url)}`);
const response = await fetch(url, {
...options,
signal: controller.signal
@@ -114,7 +114,7 @@ const fetchWithTimeout = async (url: string, options: RequestInit, timeout = 500
* 获取模拟响应数据
*/
function getMockResponse<T>(endpoint: string): ApiResponse<T> {
console.log(`[开发模式] 使用模拟数据: ${endpoint}`);
// console.log(`[开发模式] 使用模拟数据: ${endpoint}`);
// 移除开头的斜杠以便于匹配
const path = endpoint.startsWith('/') ? endpoint.substring(1) : endpoint;
@@ -185,7 +185,7 @@ export async function apiRequest<T>(
// 针对 PostgREST 的额外处理
if (endpoint.includes('evaluation_point_groups') && (options.method === 'POST' || options.method === 'PATCH')) {
console.log('使用 PostgREST 特定配置处理请求');
// console.log('使用 PostgREST 特定配置处理请求');
// 确保请求体是有效的 JSON 对象
if (options.body && typeof options.body === 'string') {
try {
@@ -197,9 +197,9 @@ export async function apiRequest<T>(
}
}
console.log(`client.ts->发送 ${options.method || 'GET'} 请求到: ${decodeUrlForDisplay(url)}`);
// console.log(`client.ts->发送 ${options.method || 'GET'} 请求到: ${decodeUrlForDisplay(url)}`);
if (options.body) {
console.log(`client.ts->请求体: \n${options.body}`);
// console.log(`client.ts->请求体: \n${options.body}`);
}
// 发送请求,10秒超时
@@ -226,7 +226,7 @@ export async function apiRequest<T>(
}
} catch (e) {
console.error('解析响应失败:', e);
console.log('原始响应:', responseText);
// console.log('原始响应:', responseText);
}
// 收集响应头信息