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
@@ -0,0 +1,22 @@
'use client';
import { IamSectionCard } from '@/components/iam/IamSectionCard';
import { MenuTreeView } from '@/components/iam/MenuTreeView';
import { useApi } from '@/lib/hooks/use-api';
import { iamMenu } from '@/lib/api/iam';
import type { MenuNode } from '@/lib/api/types/menu';
export default function IamResourcePage() {
const { data, loading, error } = useApi<MenuNode[]>(() => iamMenu.tree());
return (
<IamSectionCard
title="资源(菜单)"
description="全局菜单树,对接 GET /api/v1/iam/menu/tree;与侧栏 nav 数据源一致(nav 会按角色过滤)。"
>
{loading ? <p className="text-sm text-neutral-500"></p> : null}
{error ? <p className="text-sm text-red-600">{error}</p> : null}
{!loading && !error && data ? <MenuTreeView tree={data} /> : null}
</IamSectionCard>
);
}