Browse Source

(*)权限控制完善

master
peng.peng 1 year ago
parent
commit
4032c3333c
  1. 28
      web/client/src/layout/components/header/index.js
  2. 4
      web/client/src/sections/metadataAcquisition/nav-item.js

28
web/client/src/layout/components/header/index.js

@ -66,19 +66,21 @@ const Header = props => {
label: <span style={{ color: 'aliceblue' }}>{user.displayName}</span>, label: <span style={{ color: 'aliceblue' }}>{user.displayName}</span>,
key: "user", key: "user",
icon: <img className={styles['header-nav-user-img']} src={`/assets/images/avatar/5.png`} />, icon: <img className={styles['header-nav-user-img']} src={`/assets/images/avatar/5.png`} />,
children: [{ children: [
label: '退出', key: 'logout' {
}, icon: <UserOutlined />,
{ label: <ResetPasswordModal
label: <ResetPasswordModal editData={user}
editData={user} triggerRender={<a>重置密码</a>}
triggerRender={<a>重置密码</a>} title="重置密码"
title="重置密码" onFinish={onFinish}
onFinish={onFinish} key="resetPassword"
key="resetPassword" />,
/>, key: 'resetPassword'
key: 'resetPassword' },
} {
label: '退出', key: 'logout', icon: <LogoutOutlined />
},
], ],
}]} }]}
/> />

4
web/client/src/sections/metadataAcquisition/nav-item.js

@ -4,9 +4,9 @@ import { Menu } from 'antd';
import { BarChartOutlined } from '@ant-design/icons'; import { BarChartOutlined } from '@ant-design/icons';
const SubMenu = Menu.SubMenu; const SubMenu = Menu.SubMenu;
export function getNavItem() { export function getNavItem(user) {
return ( return (
<SubMenu key="metadataAcquisition" icon={<BarChartOutlined />} title='元数据采集'> user?.role == '系统管理员' && <SubMenu key="metadataAcquisition" icon={<BarChartOutlined />} title='元数据采集'>
<Menu.Item key="Adapter"> <Menu.Item key="Adapter">
<Link to="/metadataAcquisition/Adapter">适配器管理</Link> <Link to="/metadataAcquisition/Adapter">适配器管理</Link>
</Menu.Item> </Menu.Item>

Loading…
Cancel
Save