feat: 业务员角色权限限制 + 客户查看弹窗

- 新增 acl.ts 工具:isSuperAdmin/SUPER_ADMIN;utils.ts 加 maskPhone
- 侧边栏按角色过滤:系统管理菜单仅超管可见
- /rbac 路由服务端拦截:非超管访问重定向首页
- 客户列表:业务员手机号脱敏(中间5位星号)、删除按钮隐藏、新增查看按钮
- 删除服务端校验:仅超管可执行
- 新增 customer-view.tsx 查看弹窗,展示完整商户信息(含完整手机号)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-12 00:06:00 +08:00
co-authored by Claude Opus 4.8
parent 689c0de91d
commit 2bb2945678
9 changed files with 166 additions and 7 deletions
+3 -2
View File
@@ -8,10 +8,11 @@ import { BrandLogo } from "./brand-logo";
import { navSections, activeHref } from "./nav";
import { useSidebar } from "./sidebar-context";
export function Sidebar() {
export function Sidebar({ isSuperAdmin }: { isSuperAdmin: boolean }) {
const pathname = usePathname();
const active = activeHref(pathname);
const { collapsed } = useSidebar();
const sections = navSections.filter((s) => !s.superAdminOnly || isSuperAdmin);
return (
<aside
@@ -30,7 +31,7 @@ export function Sidebar() {
</div>
<nav className="flex-1 space-y-6 overflow-y-auto px-3 py-4">
{navSections.map((section) => (
{sections.map((section) => (
<div key={section.title}>
<div className="px-3 pb-2 text-[11px] font-medium uppercase tracking-wider text-[var(--color-sidebar-muted)]">
{section.title}