分割仓库标识获取版本号信息
This commit is contained in:
parent
b2e048bfdb
commit
33ba70459f
|
|
@ -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 <div className="homepage-box">
|
||||
{/* banner区域内容 */}
|
||||
<div className="width1600 mb40">
|
||||
|
|
|
|||
Loading…
Reference in New Issue