From d74fc74f2825ebec48fde7124c2834210c9da1e6 Mon Sep 17 00:00:00 2001 From: yuzhiran Date: Mon, 22 Jun 2026 12:51:58 +0800 Subject: [PATCH] feat(admin): convert all timestamps to Beijing time (UTC+8) for display Create utils/format.ts with toBeijing() helper. Replace 13 raw .slice().replace() date displays in admin.vue with centralized timezone-aware formatting. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- zhiyin-app/src/pages/admin/admin.vue | 27 ++++++++++++++------------- zhiyin-app/src/utils/format.ts | 17 +++++++++++++++++ 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 zhiyin-app/src/utils/format.ts diff --git a/zhiyin-app/src/pages/admin/admin.vue b/zhiyin-app/src/pages/admin/admin.vue index abddc00..93960fb 100644 --- a/zhiyin-app/src/pages/admin/admin.vue +++ b/zhiyin-app/src/pages/admin/admin.vue @@ -97,12 +97,12 @@ - 注册:{{ u.createdAt?.slice(0,16).replace('T',' ') }} + 注册:{{ toBeijing(u.createdAt) }} 到期:{{ u.vipExpireAt?.slice(0,10) }} 冲刺到期:{{ u.sprintExpireAt?.slice(0,10) }} - 最后登录:{{ u.lastLoginAt?.slice(0,16).replace('T',' ') }} + 最后登录:{{ toBeijing(u.lastLoginAt) }} IP:{{ u.lastLoginIp }} {{ u.lastLoginLocation }} @@ -138,8 +138,8 @@ 语气 {{ iv.fillerScore }}/{{ iv.fillerDensity ?? '-' }} - 开始:{{ iv.createdAt?.slice(0,16).replace('T',' ') }} - 更新:{{ iv.updatedAt?.slice(0,16).replace('T',' ') }} + 开始:{{ toBeijing(iv.createdAt) }} + 更新:{{ toBeijing(iv.updatedAt) }} {{ iv.summary.slice(0,60) }}{{ iv.summary.length > 60 ? '...' : '' }} @@ -168,8 +168,8 @@ - 创建:{{ r.createdAt?.slice(0,16).replace('T',' ') }} - 更新:{{ r.updatedAt?.slice(0,16).replace('T',' ') }} + 创建:{{ toBeijing(r.createdAt) }} + 更新:{{ toBeijing(r.updatedAt) }} 删除 @@ -208,14 +208,14 @@ 渠道:{{ o.channel || '--' }} - 创建:{{ o.createdAt?.slice(0,16).replace('T',' ') }} - 支付:{{ o.paidAt?.slice(0,16).replace('T',' ') }} + 创建:{{ toBeijing(o.createdAt) }} + 支付:{{ toBeijing(o.paidAt) }} 微信单号:{{ o.wxTransactionId }} - 退款:¥{{ (o.refundAmount/100).toFixed(1) }} {{ o.refundedAt?.slice(0,16).replace('T',' ') }} + 退款:¥{{ (o.refundAmount/100).toFixed(1) }} {{ toBeijing(o.refundedAt) }} 原因:{{ o.refundReason }} @@ -356,7 +356,7 @@ @@ -375,8 +375,8 @@ {{ v.credited ? '已积分' : '未积分' }} @@ -517,7 +517,7 @@ {{ a.plan === 'growth' || a.plan === 'sprint' ? a.plan==='sprint'?'冲刺':'会员' : '免费' }} - 设置:{{ a.createdAt?.slice(0,16).replace('T',' ') }} + 设置:{{ toBeijing(a.createdAt) }} 暂无管理员 @@ -555,6 +555,7 @@