diff --git a/src/apps/admin/layout/index.tsx b/src/apps/admin/layout/index.tsx index b084785..81b81cb 100644 --- a/src/apps/admin/layout/index.tsx +++ b/src/apps/admin/layout/index.tsx @@ -33,6 +33,13 @@ export default function AdminLayout(props: AdminLayoutProps) { } } + function checkAllowAccessSetting() { + const username = user?.username; + const allowList = ['Endy', 'superadmin']; + if (allowList.includes(username)) return true; + return false; + } + return (
{ + const isAllowSetting = checkAllowAccessSetting(); + if (!isAllowSetting && (item.key === '1' || item.type === 'divider')) { + return undefined; + } + return item; + }) + .filter(Boolean) as any, }} >