态势感知平台-全球开源风险态势感知监控中心接口字段修改
This commit is contained in:
@@ -34,19 +34,20 @@ const fetchLanguageTrendData = async () => {
|
||||
try {
|
||||
console.log('开始请求漏洞语言分布数据...');
|
||||
const response = await languageTrendPage1();
|
||||
const businessData = response.data; // Axios响应格式,业务数据在response.data中
|
||||
console.log('API响应:', response);
|
||||
|
||||
if (response?.code === 0) {
|
||||
console.log('API返回的数据:', response.data);
|
||||
if (businessData?.code === 200) {
|
||||
console.log('API返回的数据:', businessData.data);
|
||||
|
||||
// 处理后端返回的数据格式
|
||||
const processedData = processBackendData(response.data);
|
||||
const processedData = processBackendData(businessData.data);
|
||||
languageTrendData.value = processedData;
|
||||
|
||||
// 更新空数据标识
|
||||
isEmpty.value.languageTrend = !processedData.years || processedData.years.length === 0;
|
||||
} else {
|
||||
console.error('获取漏洞语言分布数据失败:', response?.msg || '未知错误');
|
||||
console.error('获取漏洞语言分布数据失败:', businessData?.msg || '未知错误');
|
||||
// 设置默认数据
|
||||
setDefaultData();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user