diff --git a/src/api/jyh/index.ts b/src/api/jyh/index.ts index 30be22b..c5cd9a3 100644 --- a/src/api/jyh/index.ts +++ b/src/api/jyh/index.ts @@ -134,3 +134,25 @@ export function getVulnerabilityList() { } }); } + +// 获取漏洞数据 +export const getVulnList = (data): Promise => { + return reqCatchV2(() => + request({ + url: `/api/v1/repo/vulnerability/page`, + method: 'post', + data, + }) + ); +} + +// 获取漏洞数据 +export const getVulnDetail = (data): Promise => { + return reqCatchV2(() => + request({ + url: `/api/v1/repo/vulnerability/info`, + method: 'POST', + data, + }) + ); +} diff --git a/src/api/repo/index.ts b/src/api/repo/index.ts index 3ba175c..435680d 100644 --- a/src/api/repo/index.ts +++ b/src/api/repo/index.ts @@ -1543,13 +1543,3 @@ export const getOriginalComment = (params: types.DiscussionCommentProps): Promis ); } -// 获取漏洞数据 -export const getVulnDetail = (params: types.VulnDetailProps): Promise => { - return reqCatch(() => - request({ - url: `/api/v1/repo/vulnerability/info`, - method: 'get', - params, - }) - ); -} diff --git a/src/views/Jyh/Version/Detail/VulnerabilitiesList.vue b/src/views/Jyh/Version/Detail/VulnerabilitiesList.vue index e1dea28..06d6451 100644 --- a/src/views/Jyh/Version/Detail/VulnerabilitiesList.vue +++ b/src/views/Jyh/Version/Detail/VulnerabilitiesList.vue @@ -102,8 +102,8 @@ - - + + @@ -245,12 +245,15 @@ const vulnDetailVisable = ref(false); const currentVuln = ref(); const openVulnDetail = (row) => { vulnDetailVisable.value = true; - currentVuln.value = row; -}; - -onMounted(async () => { - await getVulnerabilityList(); -}); + if(row.softwareId && row.id) { + currentVuln.value = row; + } else { + currentVuln.value = { + softwareId: 47, + id: 72 + } + } +}