From a031d9a8ccc50f59d1075bb089e2e7ebf958f487 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Mon, 29 Jun 2020 15:28:24 +0800 Subject: [PATCH] FIX bug --- src/forge/Main/Detail.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 2dc4ac1a..a177234e 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -156,13 +156,14 @@ class Detail extends Component { componentDidUpdate = (prevState) => { if ((prevState.match.params.projectsId !== this.props.match.params.projectsId)) { + this.getProject(); this.getDetail(); } } getProject = () => { const { projectsId } = this.props.match.params; - const url = `/repositories/${projectsId}.json`; + const url = `/projects/${projectsId}/simple.json`; axios.get(url).then((result) => { this.setState({ project: result.data @@ -172,7 +173,7 @@ class Detail extends Component { getDetail = () => { const { projectsId } = this.props.match.params; - const url = `/repositories/${projectsId}/simple.json`; + const url = `/repositories/${projectsId}.json`; axios.get(url).then((result) => { if (result) { this.setState({ @@ -285,6 +286,7 @@ class Detail extends Component { axios.post(url).then(result=>{ if(result && result.data && result.data.status === 0){ this.props.showNotification("镜像同步成功!"); + this.getProject(); this.getDetail(); }else{ this.props.showNotification("镜像同步失败!");