From 33ba70459fa82156b80c6d3f8c9768d69ca73743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= Date: Tue, 10 Mar 2026 09:20:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=89=B2=E4=BB=93=E5=BA=93=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E8=8E=B7=E5=8F=96=E7=89=88=E6=9C=AC=E5=8F=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/projectHome/explore/index.jsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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
{/* banner区域内容 */}