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 ? } title={'授权管理'}> {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'USERMANAGE')?.length !== 0 ? < Menu.Item key="userManage"> 用户管理 : '' } {user?.username == 'SuperAdmin' || user?.userResources?.filter(i => i.resourceId === 'AUTHORIMANAGE')?.length !== 0 ? 权限管理 : ''} : null ) }