将url中localhost端口改为当前host端口

This commit is contained in:
zh
2025-07-11 09:19:20 +08:00
parent 399725ed06
commit 579b76dc0e
8 changed files with 99 additions and 23 deletions

View File

@ -14,6 +14,7 @@ import { getTheme, setTheme } from "../Obj/Element/theme";
import { setActiveViewer as setMultiViewportActiveViewer } from './MultiViewportMode'
import { setActiveViewer as setSplitActiveViewer, getSdk } from './SplitScreen'
import { updateCluster } from './cluster/cluster'
import { getHost } from "../on";
let coordinateSystem = 'EPSG:4326'
let _cartesian
@ -244,6 +245,16 @@ function setBillboardDefaultUrl(url, name) {
else {
name = 'billboard_default_url'
}
let host = getHost()
if (!url.startsWith("http")) {
//说明是本地的json在磁盘中存在的
if (!url.includes(":")) {
if (host) {
let o = new URL(url, host)
url = o.href
}
}
}
localStorage.setItem(name, url);
}
/*获取广告牌默认图标*/