refactor: 重构API接口响应格式,带来简洁高效的接口设计 (#1256)

This commit is contained in:
xiaoming
2026-01-10 08:58:20 +08:00
committed by GitHub
parent ebc92ba61c
commit f2616fdfaf
30 changed files with 210 additions and 131 deletions

View File

@@ -92,14 +92,16 @@ onBeforeMount(() => {
// 获取模拟车辆信息
mapJson()
.then(({ data }) => {
const points: object = data.map(v => {
return {
lnglat: [v.lng, v.lat],
...v
};
});
if (MarkerCluster) MarkerCluster.setData(points);
.then(({ code, data }) => {
if (code === 0) {
const points: object = data.map(v => {
return {
lnglat: [v.lng, v.lat],
...v
};
});
if (MarkerCluster) MarkerCluster.setData(points);
}
})
.catch(err => {
console.log("err:", err);