优化客户端请求时候操作的页面不更新

This commit is contained in:
2025-06-06 10:21:14 +08:00
parent ce4e621741
commit 358e9ab745
10 changed files with 162 additions and 81 deletions
+10 -9
View File
@@ -84,17 +84,17 @@ function logPostgrestQuery(endpoint: string, params?: QueryParams, method: strin
}
}
console.log('\n📦 PostgREST 查询日志 ========================');
console.log(`📦 HTTP 方法: ${method}`);
console.log(`📦 完整 URL: ${decodeUrlForDisplay(fullUrl)}`);
// console.log('\n📦 PostgREST 查询日志 ========================');
// console.log(`📦 HTTP 方法: ${method}`);
// console.log(`📦 完整 URL: ${decodeUrlForDisplay(fullUrl)}`);
// 打印请求体数据(仅适用于POST/PATCH/PUT请求)
if (['POST', 'PATCH', 'PUT'].includes(method) && data) {
console.log('📦 请求体数据:');
console.log(JSON.stringify(data, null, 2));
}
// if (['POST', 'PATCH', 'PUT'].includes(method) && data) {
// console.log('📦 请求体数据:');
// console.log(JSON.stringify(data, null, 2));
// }
console.log('📦 PostgREST 查询日志 ========================\n');
// console.log('📦 PostgREST 查询日志 ========================\n');
}
}
@@ -467,7 +467,8 @@ export async function postgrestPut<T, D extends object>(
headers: {
'Prefer': 'return=representation'
}
}
},
queryParams
);
if (response.error) {