物理沙盘
This commit is contained in:
@ -326,20 +326,24 @@
|
||||
arr.forEach(item => {
|
||||
console.log(fs.existsSync(item.url));
|
||||
if (fs.existsSync(item.url)) {
|
||||
if (!item.url.startsWith('http')) {
|
||||
// if (item.url.indexOf(":/") > -1) {
|
||||
// ipcRenderer.send('setStaticFile', item.url)
|
||||
// let name = item.url.replaceAll("\\", "/").split("/").pop()
|
||||
// item.url = location.origin + "/" + name
|
||||
// item.url = this.info.env + "/yjearth4.0/api/v1/picture/getBypath?path=" + item.url
|
||||
item.url = this.info.env + "/yjearth4.0/api/v1/picture/getBypath?path=" + encodeURIComponent(item.url)
|
||||
// item.url
|
||||
// }
|
||||
}
|
||||
item.url = this.info.env + "/yjearth4.0/api/v1/picture/getBypath?path=" + encodeURIComponent(item.url)
|
||||
} else {
|
||||
if (!item.url.startsWith('http')) {
|
||||
// item.url = this.info.env + "/" + item.url
|
||||
item.url = this.info.env + "/" + encodeURIComponent(item.url)
|
||||
try {
|
||||
let urlObject = new URL(item.url)
|
||||
if (urlObject.protocol !== 'https:' && urlObject.protocol !== 'http:') {
|
||||
item.url = "https://" + item.url
|
||||
}
|
||||
urlObject = new URL(item.url)
|
||||
if (urlObject.hostname === 'localhost') {
|
||||
item.url = this.info.env + decodeURIComponent(urlObject.pathname)
|
||||
}
|
||||
} catch (error) {
|
||||
if (item.url.startsWith('/') || item.url.startsWith('\\')) {
|
||||
item.url = this.info.env + encodeURIComponent(item.url)
|
||||
}
|
||||
else {
|
||||
item.url = this.info.env + "/" + encodeURIComponent(item.url)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -409,9 +413,29 @@
|
||||
if (hasVr) {
|
||||
this.info.vr.forEach(item => {
|
||||
console.log(item);
|
||||
if (!item.url.startsWith('http')) {
|
||||
if (fs.existsSync(item.url)) {
|
||||
item.url = this.info.env + '/yjearth4.0/api/v1/picture/getBypath?path=' + encodeURIComponent(item.url)
|
||||
}
|
||||
else {
|
||||
try {
|
||||
let urlObject = new URL(item.url)
|
||||
if (urlObject.protocol !== 'https:' && urlObject.protocol !== 'http:') {
|
||||
item.url = "https://" + item.url
|
||||
}
|
||||
urlObject = new URL(item.url)
|
||||
if (urlObject.hostname === 'localhost') {
|
||||
item.url = this.info.env + decodeURIComponent(urlObject.pathname)
|
||||
}
|
||||
} catch (error) {
|
||||
if (item.url.startsWith('/') || item.url.startsWith('\\')) {
|
||||
item.url = this.info.env + decodeURIComponent(item.url)
|
||||
}
|
||||
else {
|
||||
item.url = this.info.env + "/" + decodeURIComponent(item.url)
|
||||
}
|
||||
// alert(item.url)
|
||||
}
|
||||
}
|
||||
this.tabsData.unshift({ name: item.name, type: '全景图', url: item.url })
|
||||
})
|
||||
this.activeItem = this.tabsData[this.activeIndex]
|
||||
|
||||
Reference in New Issue
Block a user