diff --git a/src/forge/Main/projectHomeNew/v2/index.jsx b/src/forge/Main/projectHomeNew/v2/index.jsx index 36d63fed..73ad7104 100644 --- a/src/forge/Main/projectHomeNew/v2/index.jsx +++ b/src/forge/Main/projectHomeNew/v2/index.jsx @@ -22,7 +22,7 @@ function ProjectHomePage(props) { const [topicId, setTopicId] = useState(undefined); const [topicDetail, setTopicDetail] = useState(undefined); const [count, setCount] = useState({}); - const {countByGHM, countByOther} = count; + const {countByGHM, countByOther, countByGHMType} = count; const topicsByCateId = cateTopics && cateTopics[cateID]; // const topicsByCateId = cateTopics && cateTopics[cateID] || [ // { @@ -65,7 +65,8 @@ function ProjectHomePage(props) { function getInitCount() { const obj = { countByGHM: 0, - countByOther: 0 + countByOther: 0, + countByGHMType: 0 } axios.get(`/organizations/gh_mirrors/projects.json?page=1&limit=15&sort_by=updated_on&sort_direction=desc`).then(result => { if (result && result.data) { @@ -76,8 +77,10 @@ function ProjectHomePage(props) { if (result && result.data) { obj.countByOther = result.data.total_count - obj.countByGHM } + }).finally(()=>{ + cateTopics[39] && (obj.countByGHMType = cateTopics[39].length) setCount(obj); - }).catch(error => { }) + }) } function getCateTopic() { @@ -152,12 +155,17 @@ function ProjectHomePage(props) {
{countByOther}
- 软件包总数 + 软件数量 +{countByGHMType}
+ 支持三方组件类型{countByGHM}
- 可信三方组件数 + 三方组件数