fix: 静态资源文件路径解析

This commit is contained in:
TsMask
2024-10-28 17:21:52 +08:00
parent f23d4117d7
commit 5f9d19ac65
2 changed files with 16 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import {
} from '@/api/monitor/topology';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { Form, Modal, message } from 'ant-design-vue/es';
import { parseBasePath } from '@/plugins/file-static-url';
const { t } = useI18n();
const { graphMode, graphModeOptions, handleRanderGraph, handleChangeMode } =
useGraph();
@@ -80,6 +81,14 @@ function fnGraphDataLoad(reload: boolean = false) {
getGraphData(graphState.group)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
res.data.nodes.map((item: any) => {
// 图片路径处理
if (item.img) item.img = parseBasePath(item.img);
if (item.icon.show && item.icon?.img) {
item.icon.img = parseBasePath(item.icon.img);
}
return item;
});
graphState.data = res.data;
}
})