From dde76c1123e008b8ef3ba6fdc89c92ba785f89dc Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 30 May 2023 14:26:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/Component/publicBanner.jsx | 4 +++- src/forge/Information/index.jsx | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) 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(
- +