diff --git a/src/forge/projectHome/explore/index.jsx b/src/forge/projectHome/explore/index.jsx index c97d4a284..41824d96f 100644 --- a/src/forge/projectHome/explore/index.jsx +++ b/src/forge/projectHome/explore/index.jsx @@ -131,9 +131,11 @@ function ProjectHomePage(props) { // 遍历projects,请求供应链治理接口 获取可信等级 const projectsWithTrustLevel = result.data.projects.map(async project => { try { + const [part1, part2] = splitLastUnderscore(project.identifier); const response = await axios.post(`${governance}/detect/software/trustPage`, { - softwareName: project.identifier, + softwareName: part1, + softwareVersion: part2, size: 1, current: 1 } @@ -172,6 +174,15 @@ function ProjectHomePage(props) { }).catch(error => { }) } + function splitLastUnderscore(str) { + const parts = str.split('_'); + const lastPart = parts.length > 1 ? parts.pop() : ''; + const firstPart = parts.join('_'); + return [firstPart, lastPart]; + } + +// 测试 + return