task-261(admin.html观感对齐): 数字人版本页对齐(状态/最新★/文件大小/MD5截断/操作矩阵/上传文案/删除)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/** 数字人版本展示格式化(module 13 task 261):MD5 截断展示;纯逻辑。 */
|
||||
|
||||
/** MD5 前 len 位(默认 12,对齐 admin)展示;空值回空串。 */
|
||||
export function md5Short(md5: string | null | undefined, len = 12): string {
|
||||
const text = typeof md5 === 'string' ? md5.trim() : ''
|
||||
if (!text) return ''
|
||||
const max = typeof len === 'number' && Number.isFinite(len) && len >= 1 ? Math.floor(len) : 12
|
||||
return text.length <= max ? text : `${text.slice(0, max)}…`
|
||||
}
|
||||
Reference in New Issue
Block a user