diff --git a/src/forge/Information/Component/publicBanner.jsx b/src/forge/Information/Component/publicBanner.jsx index 5c0735922..3f93e9e5d 100644 --- a/src/forge/Information/Component/publicBanner.jsx +++ b/src/forge/Information/Component/publicBanner.jsx @@ -13,7 +13,8 @@ import { Link } from 'react-router-dom'; function PublicBanner(props){ const [ key , setKey ] = useState("1"); const { pathname } = props.history.location; - const { data } = props; + const { data , adminUrl } = props; + useEffect(()=>{ if(pathname){ @@ -54,6 +55,7 @@ function PublicBanner(props){ 领域资讯 {/* Sig小组 */} 专区会员 + { adminUrl && {window.location.href=adminUrl}}>后台管理 } diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 1e0d0b951..8a2c50902 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -39,6 +39,7 @@ const Main = Loadable({ }); function Index(props){ const [ data , setData ] = useState(undefined); + const [ adminUrl , setAdminUrl ] = useState(undefined); const { deptId } = props.match.params; useEffect(()=>{ @@ -64,9 +65,21 @@ function Index(props){ useEffect(()=>{ if(deptId){ getDetail(); + getAdminUrl(); } },[deptId]) + function getAdminUrl(){ + const url = `/zone/zoneDetail/${deptId}/checkZoneRole`; + axios.get(url).then(response=>{ + if(response && response.data.code === 200){ + setAdminUrl(response.data.data); + }else{ + setAdminUrl(undefined); + } + }).catch(error=>{}) + } + function getDetail(){ const url = `/zone/open/${deptId}`; axios.get(url).then(result=>{ @@ -77,7 +90,7 @@ function Index(props){ } return(
- +