数据由展示每天的改为累计的

This commit is contained in:
LL
2025-11-19 09:31:41 +08:00
parent 2c9c06bf45
commit 0c5ecababa
2 changed files with 65 additions and 4 deletions

View File

@@ -47,10 +47,13 @@ document.addEventListener('DOMContentLoaded', () => {
body: JSON.stringify(payload)
});
const j = await r.json();
if (j && j.success && j.today) updateStatsUI(j.today);
if (j && j.success) {
const t = j.total || j.today;
updateStatsUI(t);
}
} catch {}
};
(async () => { try { const r = await fetch('api/stats.php'); const j = await r.json(); if (j && j.success && j.today) updateStatsUI(j.today); } catch {} })();
(async () => { try { const r = await fetch('api/stats.php'); const j = await r.json(); if (j && j.success) updateStatsUI(j.total || j.today); } catch {} })();
track({ event: 'visit', page: location.pathname });
// 底部工具栏与标题已移除,无需获取相关元素