feat: 更新管理员导航,重定向菜单权限至根路径,添加角色同步API,移除菜单权限模块

This commit is contained in:
2026-05-13 10:40:12 +08:00
parent 188c6a04cf
commit 96b966cf62
15 changed files with 640 additions and 243 deletions

View File

@@ -93,8 +93,6 @@ export function ShellToolbar() {
adminProfile?.username?.trim() ||
"管理员";
const permissionCount = adminProfile?.permissions?.length ?? 0;
function onLogout() {
clearSession();
toast.success("已退出登录");
@@ -170,15 +168,8 @@ export function ShellToolbar() {
{initialsFromProfile(adminProfile)}
</AvatarFallback>
</Avatar>
<span className="hidden min-w-0 flex-1 flex-col sm:flex">
<span className="truncate text-sm font-semibold leading-tight">
{displayName}
</span>
<span className="truncate text-xs text-muted-foreground">
{permissionCount > 0
? `${permissionCount} 项功能权限 · 菜单已按角色过滤`
: "重新登录可同步权限与侧栏菜单"}
</span>
<span className="hidden min-w-0 flex-1 truncate text-sm font-semibold leading-tight sm:block">
{displayName}
</span>
<ChevronDownIcon className="hidden size-4 shrink-0 text-muted-foreground sm:block" />
</DropdownMenuTrigger>