fix(admin): 观看时间统一格式化为 yyyy-MM-dd HH:mm:ss

后端改输出格式后仍保留前端兜底,同时修掉用户详情里的原始 ISO 展示。
This commit is contained in:
Vicky authored and trae-solo-agent committed 2026-10-27 14:39:18 +08:00
1 parent 111bbdaeb7
commit daf681ae1a
3 files changed
+14 -3

No files matched your search

@@ -1,6 +1,7 @@
// Author: fruit.com.cn
import { onMounted, reactive, ref } from 'vue'
import dayjs from 'dayjs'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
getAppUserApi,
@@ -50,6 +51,11 @@ export function systemText(row) {
return text || '—'
}
/** 后端返回 ISO 时间串,统一格式化成后台可读的本地时间 */
export function formatDateTime(value) {
return value && dayjs(value).isValid() ? dayjs(value).format('YYYY-MM-DD HH:mm:ss') : '—'
}
/** 毫秒转 mm:ss,观看流水里的进度用 */
export function formatDuration(ms) {
const total = Math.max(0, Math.floor((ms || 0) / 1000))