task-250(admin.html观感对齐): 用户管理列表页对齐(说明/所属管理员筛选/角色中文/删除文案/分页)

This commit is contained in:
2026-09-05 21:13:03 +08:00
parent b393705199
commit baed3b30de
3 changed files with 130 additions and 15 deletions
+11
View File
@@ -50,6 +50,17 @@ export function parseUserPage(payload: unknown): UserPageResult {
if (typeof rawSize === 'number' && rawSize >= 1) out.pageSize = Math.floor(rawSize)
if (typeof record.current_user_id === 'number') out.currentUserId = record.current_user_id
if (typeof record.current_user_username === 'string') out.currentUserUsername = record.current_user_username
if (Array.isArray(record.admins)) {
out.admins = record.admins
.map((raw) => {
if (!raw || typeof raw !== 'object') return null
const r = raw as Record<string, unknown>
const id = numberOrNull(r.id)
if (id === null) return null
return { id, username: text(r.username) }
})
.filter((a): a is { id: number; username: string } => a !== null)
}
return out
}