parent
e6481aa606
commit
29ff09d3aa
|
@ -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 (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<Header
|
<Header
|
||||||
|
@ -81,7 +88,15 @@ export default function AdminLayout(props: AdminLayoutProps) {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
]
|
||||||
|
.map((item) => {
|
||||||
|
const isAllowSetting = checkAllowAccessSetting();
|
||||||
|
if (!isAllowSetting && (item.key === '1' || item.type === 'divider')) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
})
|
||||||
|
.filter(Boolean) as any,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Avatar size={35} style={{ cursor: 'pointer' }}>
|
<Avatar size={35} style={{ cursor: 'pointer' }}>
|
||||||
|
|
Loading…
Reference in New Issue