态势感知平台-全球开源风险态势感知监控中心接口字段修改
This commit is contained in:
@@ -96,11 +96,12 @@ const handleResize = () => {
|
||||
const fetchIndustryData = async () => {
|
||||
try {
|
||||
const response = await industryDistributionPage1();
|
||||
if (response.code === 200) {
|
||||
internalData.value = response.data;
|
||||
const businessData = response.data; // Axios响应格式,业务数据在response.data中
|
||||
|
||||
if (businessData.code === 200 && businessData.data) {
|
||||
internalData.value = businessData.data;
|
||||
} else {
|
||||
console.error('获取行业分布数据失败:', response.msg);
|
||||
// 如果接口调用失败,使用默认数据
|
||||
console.error('获取行业分布数据失败:', businessData.msg || '未知错误');
|
||||
internalData.value = [
|
||||
{ value: 25.8, name: '人工智能' },
|
||||
{ value: 18.4, name: '云计算' },
|
||||
@@ -114,7 +115,6 @@ const fetchIndustryData = async () => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('请求行业分布数据时发生错误:', error);
|
||||
// 发生异常时使用默认数据
|
||||
internalData.value = [
|
||||
{ value: 25.8, name: '人工智能' },
|
||||
{ value: 18.4, name: '云计算' },
|
||||
|
||||
Reference in New Issue
Block a user