feat(leaderboard): 训练完强刷 + 下拉刷新 force

- 云函数 _fetchLatestByOpenid 支持 force 跳过实例缓存重新扫描
- 训练完成设 _lb_force_refresh 标志,下次打开排行榜强刷,新数据立即可见
- 下拉刷新带 force=true,拉取最新数据
- 平时常规打开仍走 5min 缓存 + 客户端乐观缓存,不增加无谓扫描

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-28 08:47:41 +08:00
parent e2becc24aa
commit b42d080826
4 changed files with 22 additions and 15 deletions
+2
View File
@@ -403,6 +403,8 @@ Page({
// Flag for the index page's "训练完成" highlight
try { wx.setStorageSync('_last_train_at', Date.now()) } catch (e) {}
// 标记排行榜强刷:下次打开排行榜跳过云函数缓存,让刚训练的数据立即可见
try { wx.setStorageSync('_lb_force_refresh', true) } catch (e) {}
const finalStreak = storage.getStreak().count