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 <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -97,12 +97,12 @@
|
||||
<text class="meta-tag share" v-if="u.shareCredits > 0">分享:{{ u.shareCredits }}</text>
|
||||
</view>
|
||||
<view class="user-meta-row time-row">
|
||||
<text class="time-label">注册:{{ u.createdAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label">注册:{{ toBeijing(u.createdAt) }}</text>
|
||||
<text class="time-label" v-if="u.vipExpireAt">到期:{{ u.vipExpireAt?.slice(0,10) }}</text>
|
||||
<text class="time-label" v-if="u.sprintExpireAt">冲刺到期:{{ u.sprintExpireAt?.slice(0,10) }}</text>
|
||||
</view>
|
||||
<view class="user-meta-row time-row" v-if="u.lastLoginAt">
|
||||
<text class="time-label">最后登录:{{ u.lastLoginAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label">最后登录:{{ toBeijing(u.lastLoginAt) }}</text>
|
||||
<text class="meta-tag" v-if="u.lastLoginIp">IP:{{ u.lastLoginIp }}</text>
|
||||
<text class="meta-tag" v-if="u.lastLoginLocation">{{ u.lastLoginLocation }}</text>
|
||||
</view>
|
||||
@@ -138,8 +138,8 @@
|
||||
<text class="iv-tag filler" v-if="iv.fillerScore != null && iv.fillerScore > 0">语气 {{ iv.fillerScore }}/{{ iv.fillerDensity ?? '-' }}</text>
|
||||
</view>
|
||||
<view class="iv-meta">
|
||||
<text class="time-label">开始:{{ iv.createdAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label" v-if="iv.updatedAt && iv.updatedAt !== iv.createdAt">更新:{{ iv.updatedAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label">开始:{{ toBeijing(iv.createdAt) }}</text>
|
||||
<text class="time-label" v-if="iv.updatedAt && iv.updatedAt !== iv.createdAt">更新:{{ toBeijing(iv.updatedAt) }}</text>
|
||||
</view>
|
||||
<text class="iv-summary" v-if="iv.summary">{{ iv.summary.slice(0,60) }}{{ iv.summary.length > 60 ? '...' : '' }}</text>
|
||||
</view>
|
||||
@@ -168,8 +168,8 @@
|
||||
<text class="resume-tag paid" v-if="r.paidDownload">付费下载</text>
|
||||
</view>
|
||||
<view class="resume-meta time-row">
|
||||
<text class="time-label">创建:{{ r.createdAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label" v-if="r.updatedAt && r.updatedAt !== r.createdAt">更新:{{ r.updatedAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label">创建:{{ toBeijing(r.createdAt) }}</text>
|
||||
<text class="time-label" v-if="r.updatedAt && r.updatedAt !== r.createdAt">更新:{{ toBeijing(r.updatedAt) }}</text>
|
||||
</view>
|
||||
<view class="resume-actions">
|
||||
<text class="admin-action-btn del" @click="deleteResume(r._id, r.title)">删除</text>
|
||||
@@ -208,14 +208,14 @@
|
||||
<text class="meta-tag">渠道:{{ o.channel || '--' }}</text>
|
||||
</view>
|
||||
<view class="order-meta-row time-row">
|
||||
<text class="time-label">创建:{{ o.createdAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label" v-if="o.paidAt">支付:{{ o.paidAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label">创建:{{ toBeijing(o.createdAt) }}</text>
|
||||
<text class="time-label" v-if="o.paidAt">支付:{{ toBeijing(o.paidAt) }}</text>
|
||||
</view>
|
||||
<view class="order-meta-row" v-if="o.wxTransactionId">
|
||||
<text class="time-label">微信单号:{{ o.wxTransactionId }}</text>
|
||||
</view>
|
||||
<view class="order-meta-row" v-if="o.status === 'refunded'">
|
||||
<text class="time-label refund-label">退款:¥{{ (o.refundAmount/100).toFixed(1) }} {{ o.refundedAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label refund-label">退款:¥{{ (o.refundAmount/100).toFixed(1) }} {{ toBeijing(o.refundedAt) }}</text>
|
||||
<text class="time-label" v-if="o.refundReason">原因:{{ o.refundReason }}</text>
|
||||
</view>
|
||||
<view class="order-actions-bar">
|
||||
@@ -356,7 +356,7 @@
|
||||
<text class="share-credited">有效 {{ r.creditedCount }}</text>
|
||||
</view>
|
||||
<view class="share-meta-row time-row">
|
||||
<text class="time-label">创建:{{ r.createdAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label">创建:{{ toBeijing(r.createdAt) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -375,8 +375,8 @@
|
||||
<text class="meta-tag" :class="v.credited ? 'badge-done' : 'badge-pend'">{{ v.credited ? '已积分' : '未积分' }}</text>
|
||||
</view>
|
||||
<view class="share-meta-row time-row">
|
||||
<text class="time-label">访问:{{ v.createdAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label" v-if="v.creditedAt">积分:{{ v.creditedAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label">访问:{{ toBeijing(v.createdAt) }}</text>
|
||||
<text class="time-label" v-if="v.creditedAt">积分:{{ toBeijing(v.creditedAt) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -517,7 +517,7 @@
|
||||
<text class="user-plan" :class="{ vip: a.plan === 'growth' || a.plan === 'sprint' }">{{ a.plan === 'growth' || a.plan === 'sprint' ? a.plan==='sprint'?'冲刺':'会员' : '免费' }}</text>
|
||||
</view>
|
||||
<view class="user-meta-row time-row">
|
||||
<text class="time-label">设置:{{ a.createdAt?.slice(0,16).replace('T',' ') }}</text>
|
||||
<text class="time-label">设置:{{ toBeijing(a.createdAt) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="empty-text" v-if="adminList.length === 0">暂无管理员</text>
|
||||
@@ -555,6 +555,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, reactive } from 'vue'
|
||||
import { api, API_ENDPOINTS } from '../../config'
|
||||
import { toBeijing } from '../../utils/format'
|
||||
|
||||
const verified = ref(false)
|
||||
const adminName = ref('')
|
||||
|
||||
Reference in New Issue
Block a user