SBOM树展示异常修复

This commit is contained in:
付民康
2025-03-24 18:16:52 +08:00
parent a74468a61c
commit fe6cfec2b3
2 changed files with 3 additions and 2 deletions

View File

@@ -54,7 +54,9 @@ const renameComponentsToChildren = (obj) => {
// 如果对象有 `components` 属性,将其改为 `children`
if (obj.hasOwnProperty('component')) {
obj.id = obj.component.id; // 将 components 改为 children
// 生成随机 UUID 并赋值给 id
obj.id = crypto.randomUUID(); // 使用浏览器/Node.js 原生 API
// obj.id = obj.component.id; // 将 components 改为 children
obj.libraryName = obj.component.libraryName; // 将 components 改为 children
obj.latestVersion = obj.component.latestVersion; // 将 components 改为 children
// delete obj.components; // 删除原来的 components 属性