将url中localhost端口改为当前host端口
This commit is contained in:
@ -211,8 +211,9 @@ class BillboardObject extends Base {
|
||||
let index = 0
|
||||
|
||||
let font = getFontFamily(that.labelFontFamily) || 'Helvetica'
|
||||
let url = that.replaceHost(that.options.billboard.image, that.options.host)
|
||||
that._frameImages = []
|
||||
if (that.options.billboard.image && that.options.billboard.image.endsWith('gif')) {
|
||||
if (url && url.endsWith('gif')) {
|
||||
isGlf = true
|
||||
switch (that.options.heightMode) {
|
||||
case 2:
|
||||
@ -222,7 +223,7 @@ class BillboardObject extends Base {
|
||||
}
|
||||
|
||||
let gifImg = document.createElement('img')
|
||||
gifImg.setAttribute('rel:animated_src', that.options.billboard.image)
|
||||
gifImg.setAttribute('rel:animated_src', url)
|
||||
gifImg.setAttribute('rel:auto_play', '1')
|
||||
const imgDiv = document.createElement('div')
|
||||
imgDiv.appendChild(gifImg)
|
||||
@ -272,7 +273,7 @@ class BillboardObject extends Base {
|
||||
else {
|
||||
let image = new Image()
|
||||
image.src =
|
||||
that.options.billboard.image ||
|
||||
url ||
|
||||
that.getSourceRootPath() + '/img/A-ablu-blank.png'
|
||||
switch (that.options.heightMode) {
|
||||
case 2:
|
||||
@ -720,11 +721,21 @@ class BillboardObject extends Base {
|
||||
}
|
||||
|
||||
get billboardImage() {
|
||||
return this.options.billboard.image
|
||||
let url = this.options.billboard.image
|
||||
if (url && !url.startsWith("http")) {
|
||||
//说明是本地的json,在磁盘中存在的
|
||||
if (!url.includes(":")) {
|
||||
if (this.options.host) {
|
||||
let o = new URL(url, this.options.host)
|
||||
url = o.href
|
||||
}
|
||||
}
|
||||
}
|
||||
return url
|
||||
}
|
||||
set billboardImage(v) {
|
||||
let _this = this
|
||||
this.options.billboard.image = v
|
||||
this.options.billboard.image = this.replaceHost(v, this.options.host)
|
||||
let url =
|
||||
this.options.billboard.image ||
|
||||
getBillboardDefaultUrl(this.options.billboard.defaultImage) ||
|
||||
@ -1497,10 +1508,11 @@ class BillboardObject extends Base {
|
||||
}
|
||||
|
||||
set billboardDefaultImage(v) {
|
||||
setBillboardDefaultUrl(v, this.options.billboard.defaultImage)
|
||||
let url = this.replaceHost(v, this.options.host)
|
||||
setBillboardDefaultUrl(url, this.options.billboard.defaultImage)
|
||||
this._elms.billboardDefaultImage &&
|
||||
this._elms.billboardDefaultImage.forEach(item => {
|
||||
item.src = v
|
||||
item.src = url
|
||||
})
|
||||
}
|
||||
|
||||
@ -1575,8 +1587,10 @@ class BillboardObject extends Base {
|
||||
}
|
||||
this.originalOptions = this.deepCopyObj(this.options)
|
||||
this._DialogObject.close()
|
||||
let cdoptions = this.deepCopyObj(this.options)
|
||||
cdoptions.host = ''
|
||||
this.Dialog.confirmCallBack &&
|
||||
this.Dialog.confirmCallBack(this.originalOptions)
|
||||
this.Dialog.confirmCallBack(cdoptions)
|
||||
syncData(this.sdk, this.options.id)
|
||||
syncSplitData(this.sdk, this.options.id)
|
||||
},
|
||||
|
Reference in New Issue
Block a user