态势感知中心-全球开源风险态势感知监控中心情报流对接接口

This commit is contained in:
d266377
2026-01-27 15:27:16 +08:00
parent 5c8f9273c4
commit aae51d0b6a

View File

@@ -20,39 +20,92 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
import { feedListPage1 } from '@/api/jyh/situation';
//定义组件数据结构
interface FeedData {
type: string;
content: string;
}
// 接收外部数据作为属性
const props = defineProps<{
initialData?: Array<any>;
initialData?: Array<FeedData>;
loading?: boolean;
}>();
// 情报流数据
const feedList = ref([
{
type: 'CISA',
content: 'CISA KEV新增: WordPress 的 OneClick Chat to Order 插件,存在不安全的直接对象引用漏洞 (CVE-2025-13526) '
},
{
type: '投毒',
content: '投毒监控: npm 基建级包大规模投毒事件影响chalk, debug, ansi-styles 等 18 个包'
},
{
type: 'CNVD',
content: 'CNVD预警: Google Chrome信息泄露漏洞CNVD-2025-3038304'
},
{
type: 'GitHub',
content: 'GitHub安全通告: MovableType 软件的 ContentType 页面 "编辑分类集" 功能存在存储型跨站脚本漏洞'
},
{
type: '修复',
content: '漏洞修复: Node.js 发布 v20.11.0 版本,修复 3 个高危漏洞'
},
{
type: '供应链',
content: '供应链预警: Maven 中央仓库发现 12 个伪造开源组件,包含后门程序'
//组件数据
const feedList = ref<FeedData[]>([]);
//获取情报流数据
const fetchFeedData = async () => {
try {
console.log('开始请求情报流数据...');
const response = await feedListPage1();
if (response.code === 200) {
feedList.value = response.data || [];
} else {
console.error('获取情报流数据失败:', response?.msg || '未知错误');
// 如果接口调用失败,使用默认数据
feedList.value = [
{
type: 'CISA',
content: 'CISA KEV新增: WordPress 的 OneClick Chat to Order 插件,存在不安全的直接对象引用漏洞 (CVE-2025-13526) '
},
{
type: '投毒',
content: '投毒监控: npm 基建级包大规模投毒事件影响chalk, debug, ansi-styles 等 18 个包'
},
{
type: 'CNVD',
content: 'CNVD预警: Google Chrome信息泄露漏洞CNVD-2025-3038304'
},
{
type: 'GitHub',
content: 'GitHub安全通告: MovableType 软件的 ContentType 页面 "编辑分类集" 功能存在存储型跨站脚本漏洞'
},
{
type: '修复',
content: '漏洞修复: Node.js 发布 v20.11.0 版本,修复 3 个高危漏洞'
},
{
type: '供应链',
content: '供应链预警: Maven 中央仓库发现 12 个伪造开源组件,包含后门程序'
}
];
}
} catch (error) {
console.error('获取情报流数据异常:', error);
// 发生异常时使用默认数据
feedList.value = [
{
type: 'CISA',
content: 'CISA KEV新增: WordPress 的 OneClick Chat to Order 插件,存在不安全的直接对象引用漏洞 (CVE-2025-13526) '
},
{
type: '投毒',
content: '投毒监控: npm 基建级包大规模投毒事件影响chalk, debug, ansi-styles 等 18 个包'
},
{
type: 'CNVD',
content: 'CNVD预警: Google Chrome信息泄露漏洞CNVD-2025-3038304'
},
{
type: 'GitHub',
content: 'GitHub安全通告: MovableType 软件的 ContentType 页面 "编辑分类集" 功能存在存储型跨站脚本漏洞'
},
{
type: '修复',
content: '漏洞修复: Node.js 发布 v20.11.0 版本,修复 3 个高危漏洞'
},
{
type: '供应链',
content: '供应链预警: Maven 中央仓库发现 12 个伪造开源组件,包含后门程序'
}
];
}
]);
};
// 如果提供了初始数据,则使用提供的数据
watch(() => props.initialData, (newData) => {
@@ -126,7 +179,8 @@ const resumeScroll = (containerKey: number) => {
};
// 7. 组件挂载时启动滚动
onMounted(() => {
onMounted(async() => {
await fetchFeedData(); // 获取情报流数据
nextTick(() => {
autoScroll(1);
});
@@ -142,6 +196,7 @@ onUnmounted(() => {
}
});
});
</script>
<style scoped>