🐛 fix(sidebar): fix the sidebar user permission to display navigation

This commit is contained in:
Apple\Apple
2025-06-04 14:41:18 +08:00
parent 7362047e51
commit 494c386ca8

View File

@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
import { import {
isAdmin, isAdmin,
isRoot,
showError showError
} from '../../helpers/index.js'; } from '../../helpers/index.js';
@@ -218,15 +219,17 @@ const SiderBar = () => {
itemKey: 'user', itemKey: 'user',
to: '/user', to: '/user',
icon: <IconUser />, icon: <IconUser />,
className: isAdmin() ? '' : 'tableHiddle',
}, },
{ {
text: t('系统设置'), text: t('系统设置'),
itemKey: 'setting', itemKey: 'setting',
to: '/setting', to: '/setting',
icon: <IconSetting />, icon: <IconSetting />,
className: isRoot() ? '' : 'tableHiddle',
}, },
], ],
[isAdmin(), t], [isAdmin(), isRoot(), t],
); );
const chatMenuItems = useMemo( const chatMenuItems = useMemo(