fix(admin-web): 时间渲染收口到 formatUtcTime,消灭 new Date().toLocaleString #10

Merged
marco merged 4 commits from fix/admin-review-hardening into main 2026-06-14 22:54:25 +08:00

review 发现 4 处仍用 new Date(v).toLocaleString 渲染后端 UTC 口径时间戳——
正是 lib/format.ts 头注释明令消灭的反模式(SQLite 本地/非中国浏览器会差 8h,
生产靠 +00:00 偏移侥幸正确)。统一改用 formatUtcTime 按北京显示:

  • admins: last_login_at
  • audit-logs: created_at
  • devices: completed_at
  • dashboard/HomeStatsConfig: ops_stat_config.updated_at
    均为 server_default now()/datetime.now(utc) 的 UTC 口径字段。
    HomeStatsConfig 的「下个更新时刻」用 epoch ms + 强制 Asia/Shanghai,正确,不动。

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

review 发现 4 处仍用 new Date(v).toLocaleString 渲染后端 UTC 口径时间戳—— 正是 lib/format.ts 头注释明令消灭的反模式(SQLite 本地/非中国浏览器会差 8h, 生产靠 +00:00 偏移侥幸正确)。统一改用 formatUtcTime 按北京显示: - admins: last_login_at - audit-logs: created_at - devices: completed_at - dashboard/HomeStatsConfig: ops_stat_config.updated_at 均为 server_default now()/datetime.now(utc) 的 UTC 口径字段。 HomeStatsConfig 的「下个更新时刻」用 epoch ms + 强制 Asia/Shanghai,正确,不动。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ghost added 1 commit 2026-06-14 14:22:21 +08:00
review 发现 4 处仍用 new Date(v).toLocaleString 渲染后端 UTC 口径时间戳——
正是 lib/format.ts 头注释明令消灭的反模式(SQLite 本地/非中国浏览器会差 8h,
生产靠 +00:00 偏移侥幸正确)。统一改用 formatUtcTime 按北京显示:
- admins: last_login_at
- audit-logs: created_at
- devices: completed_at
- dashboard/HomeStatsConfig: ops_stat_config.updated_at
均为 server_default now()/datetime.now(utc) 的 UTC 口径字段。
HomeStatsConfig 的「下个更新时刻」用 epoch ms + 强制 Asia/Shanghai,正确,不动。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ghost added 1 commit 2026-06-14 14:39:50 +08:00
- 截图列:缩略图 + Image.PreviewGroup 预览,URL 走 NEXT_PUBLIC_MEDIA_BASE(本地 :8770)
- 排序:ID/时间 列头服务端排序
- 筛选:状态 + 用户ID + 内容模糊 + 提交时间范围(草稿态 + 查询/重置)
- 批量:勾选 new 态 → 批量标记处理(循环 /handle + Promise.allSettled)
- 对齐用户页交互模式;依赖 app-server list_feedbacks 新增的 sort/filter 参数

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ghost added 1 commit 2026-06-14 15:03:02 +08:00
手机号/昵称原无 width,宽屏下吃满剩余空间显得失衡;操作列 fixed 230px
装不下 super_admin 的 5 个链接(详情/调金币/调现金/封禁/关调试链接)→ 换行。
- 手机号 width 130、昵称 width 150 + ellipsis(超长省略)
- 操作列 230→300 + Space wrap={false},5 链接稳定一行
- scroll.x 1100→1160 同步

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ghost added 1 commit 2026-06-14 15:37:43 +08:00
用户/提现/上报/审计日志四页从「加载更多」改为页码分页:
- 新增 usePagedList hook:页码→offset、暴露 total,配 antd Table pagination;
  与 useCursorList(加载更多)并存,详情子表/反馈页仍用后者
- CursorPage 类型加 total?
- 四页接入 pagination(页码/跳页/共 N 条/showSizeChanger);提现页移除自定义
  「每次加载」选择器,统一用 showSizeChanger(20/50/100)
- 反馈页本轮不动(后端反馈接口在 feat/feedback-iteration 迭代中)

tsc --noEmit 通过。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
marco merged commit 05a1d06e61 into main 2026-06-14 22:54:25 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WonderableAI/shaguabijia-admin-web#10