diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 2efec3940..6c47afa5c 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -67,6 +67,7 @@ function CoderDepot(props){ const [ editReadme , setEditReadme ] = useState(false); const [ pullsFlag , setPullsFlag ] = useState(true); const [ issuesFlag , setIssuesFlag ] = useState(true); + const [ releaseVersions , setReleaseVersions] = useState(undefined); const owner = props.match.params.owner; const projectsId = props.match.params.projectsId; @@ -130,6 +131,18 @@ function CoderDepot(props){ } },[projectsId,owner,pathname,defaultBranch]) + useEffect(()=>{ + axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{ + if(result && result.data){ + const release = { + "list":result.data.releases, + "total_count":result.data.releases.length + } + setReleaseVersions(release); + } + }) + },[]) + // 获取readme信息 function getReadmeInfo(path, ref) { axios.get(`/${owner}/${projectsId}/readme.json`, { @@ -542,13 +555,13 @@ function CoderDepot(props){ } {/* 发布 */} { - projectDetail && projectDetail.release_versions && + releaseVersions && diff --git a/src/forge/Main/version/version.js b/src/forge/Main/version/version.js index c28cc4b85..6c13a809d 100644 --- a/src/forge/Main/version/version.js +++ b/src/forge/Main/version/version.js @@ -63,7 +63,7 @@ function version(props) { {item.draft} - {item.tag_name} + {item.tag_name}