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