You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.4 KiB
39 lines
1.4 KiB
import React from 'react';
|
|
import { Link } from 'react-router-dom';
|
|
import { Menu } from 'antd';
|
|
import { SettingOutlined } from '@ant-design/icons';
|
|
import { Func } from '$utils';
|
|
import { push } from 'react-router-redux';
|
|
|
|
|
|
const SubMenu = Menu.SubMenu;
|
|
|
|
export function getNavItem(user, dispatch) {
|
|
// if (!Func.isAuthorized("ORG_MANAGE")) {
|
|
// return null
|
|
// }
|
|
// // console.log(!Func.isAuthorized("ORG_MANAGE"));
|
|
// if (user.type != 1 && user.type != 2 && user.type != 3) {
|
|
// dispatch(push('/fillion/infor'));
|
|
// return null
|
|
// }
|
|
const isshow = user?.userResources?.filter(i => i.resourceId === 'USERMANAGE' || i.resourceId === 'AUTHORIMANAGE')?.length !== 0
|
|
return (
|
|
user?.username == 'SuperAdmin' || isshow ?
|
|
<SubMenu key="organization" icon={<SettingOutlined />} title={'授权管理'}>
|
|
|
|
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'USERMANAGE')?.length !== 0 ? < Menu.Item key="userManage">
|
|
<Link to="/organization/user">用户管理</Link>
|
|
</Menu.Item> : ''
|
|
}
|
|
|
|
{user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')?.length !== 0 ? <Menu.Item key="userAuthority">
|
|
<Link to="/organization/authority"> 权限管理</Link>
|
|
</Menu.Item> : ''}
|
|
|
|
|
|
|
|
|
|
</SubMenu > : null
|
|
)
|
|
}
|