From daac65cb0d890560394c8f8be7219622470b8d96 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 20 Sep 2023 16:53:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E4=B9=9F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=90=8C=E6=AD=A5=E9=95=9C=E5=83=8F=E6=8C=89?= =?UTF-8?q?=E9=92=AE,=E7=82=B9=E5=87=BB=E6=97=B6=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Detail.js | 42 ++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index d81a53b3..2e72a274 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -501,22 +501,30 @@ class Detail extends Component { // 同步镜像 synchronismMirror = () => { - const { platform } = this.state; - if (!platform) return; - const { projectsId, owner } = this.props.match.params; - const url = `/${owner}/${projectsId}/sync_mirror.json`; - axios.post(url).then(result => { - if (result && result.data && result.data.status === 0) { - this.setState({ - secondSync: true - }) - this.canvasChannel(true); - } else { - this.props.showNotification("镜像同步失败!"); - } - }).catch(error => { - console.log(error); - }) + const { isManager } = this.state; + const { current_user , showLoginDialog } = this.props; + if(!(current_user && current_user.login)){ + showLoginDialog(); + return + } + if((current_user && current_user.admin) || isManager){ + const { platform } = this.state; + if (!platform) return; + const { projectsId, owner } = this.props.match.params; + const url = `/${owner}/${projectsId}/sync_mirror.json`; + axios.post(url).then(result => { + if (result && result.data && result.data.status === 0) { + this.setState({ + secondSync: true + }) + this.canvasChannel(true); + } else { + this.props.showNotification("镜像同步失败!"); + } + }).catch(error => { + console.log(error); + }) + } } textFunc = (forked_from_project_id, fork_info) => { @@ -580,7 +588,7 @@ class Detail extends Component { firstSync ? "" : { - ((current_user && current_user.admin) || isManager) && (projectDetail && projectDetail.type && projectDetail.type === 2) ? + (projectDetail && projectDetail.type && projectDetail.type === 2) ? 同步镜像 : "" } From 148bcbacf97995a79b75758c89469afe2381f5ad Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 20 Sep 2023 17:32:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=88=91=E5=8F=91=E5=B8=83=E7=9A=84?= =?UTF-8?q?=E8=B5=84=E6=BA=90/=E6=96=87=E7=AB=A0,=E5=88=97=E8=A1=A8-?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=8F=82=E6=95=B0=E5=80=BC=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/Pages/selfList.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/forge/Information/Pages/selfList.jsx b/src/forge/Information/Pages/selfList.jsx index b7b315c2..d1b36a39 100644 --- a/src/forge/Information/Pages/selfList.jsx +++ b/src/forge/Information/Pages/selfList.jsx @@ -19,6 +19,7 @@ function SelfList(props){ const [ deleId , setDeleId] = useState(undefined); const pathname = props.location.pathname; const { id , temp } = props; + const { deptId } = props.match.params; const limit = 15; useEffect(()=>{ @@ -57,7 +58,7 @@ function SelfList(props){ function getNew(){ getNewsMyList(id,{ - auditStatus:status, + auditStatus:status===0 ? 2 : status === 2 ? 0 : 1, pageSize:limit }).then(result=>{ setList(result.data.rows); @@ -109,7 +110,7 @@ function SelfList(props){ - {source ? "资源发布":"领域资讯"} + {source ? "资源发布": temp==="zone1" ? "新闻资讯":"领域资讯"} 我的{source ? "资源":"文章"}