This commit is contained in:
Jasder 2020-06-29 15:28:24 +08:00
parent 81056a2614
commit a031d9a8cc
1 changed files with 4 additions and 2 deletions

View File

@ -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("镜像同步失败!");