feat: 优化web

This commit is contained in:
2026-04-23 18:58:13 +08:00
commit 544a2f3428
160 changed files with 27327 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
/** 解析 Go 侧常见列表响应 `{ items, total, ... }` */
export function extractListItems<T>(data: unknown): T[] {
if (!data || typeof data !== 'object') {
return [];
}
const o = data as { items?: unknown; Items?: unknown };
const arr = o.items ?? o.Items;
return Array.isArray(arr) ? (arr as T[]) : [];
}