import React, { useState, uesEffect } from 'react' import { push } from 'react-router-redux'; import "./style.less" import { Tabs } from 'antd'; const { TabPane } = Tabs; const Header = (props) => { const { dispatch, tabChange, tabKey, user } = props console.log('user111', user) // const [tab, setTad] = useState("base") const onClick = (tab) => { // setTad({ tab }) tabChange(tab) } const dianji = () => { const allroutes = JSON.parse(sessionStorage.getItem('allRoutes')) || [] const hasAuth = allroutes?.filter((item) => { return user?.userResources.find((child) => { return child.resourceId === item.authCode }) }) if (user?.username === 'SuperAdmin') { dispatch(push('/fillion/infor')) } else if (hasAuth && hasAuth.length > 0) { const path = hasAuth[0].path console.log('sasa', `${path}`) dispatch(push(path)) } else { dispatch(push('/noContent')) } } return (
) } export default Header