perf: 性能优化与代码质量改进

- 添加4个数据库索引提升查询性能
- 启用ESLint并配置React支持
- 修复ESLint错误(未使用的导入和状态)
- 简化Toast组件UI样式
- 移除重复文件(server.js.backup)
- 清理.gitignore中的.next目录

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Developer
2026-03-19 09:26:04 +08:00
co-authored by Claude Opus 4.6
parent 1e478c2eaa
commit 3975bbed73
116 changed files with 1827 additions and 209 deletions
-4
View File
@@ -36,7 +36,6 @@ export default function Stats() {
const [categoryType, setCategoryType] = useState('expense');
const [selectedCategories, setSelectedCategories] = useState([]);
const [trendLoading, setTrendLoading] = useState(true);
const [categoryLoading, setCategoryLoading] = useState(true);
const trendChartRef = useRef(null);
const trendChartInstance = useRef(null);
@@ -67,15 +66,12 @@ export default function Stats() {
};
const loadCategoryData = async () => {
setCategoryLoading(true);
try {
const category = await getCategoryStats(getMonthStr(currentMonth), categoryType);
setCategoryData(category);
} catch (err) {
console.error(err);
showToast(err.message, { tone: 'error' });
} finally {
setCategoryLoading(false);
}
};