fix: 修复分页和缓存相关bug
- 前端: 移除无限滚动,改为一次性加载全部数据 - 前端: monthly-records接口添加limit=1000参数 - 前端: 修复edit-modal.js中loadListData调用参数 - 后端: 修复stats.js中getCached函数Promise处理 - 后端: 修复records.js各接口正确传递limit参数 - 后端: 修复partner-records SQL参数数量问题 - 统一版本号强制浏览器刷新缓存 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
df3a9daa65
commit
9126348d1b
@@ -22,12 +22,12 @@ function getCached(key, fetchFn) {
|
||||
const firstKey = statsCache.keys().next().value;
|
||||
statsCache.delete(firstKey);
|
||||
}
|
||||
return fetchFn().then(data => {
|
||||
return Promise.resolve(fetchFn()).then(data => {
|
||||
statsCache.set(key, { data, ts: Date.now() });
|
||||
return data;
|
||||
}).catch(err => {
|
||||
console.error('Cache fetch error:', err.message);
|
||||
return fetchFn(); // fallback to direct fetch
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user