物理沙盘

This commit is contained in:
zh
2025-11-14 09:42:30 +08:00
parent ce3c39031d
commit 4731610cdf
59 changed files with 1042 additions and 5644 deletions

View File

@ -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]

File diff suppressed because one or more lines are too long

View File

@ -80,7 +80,7 @@
},
mounted() {
window.addEventListener('message', (data) => {
this.url = data.data
this.url = decodeURIComponent(data.data)
console.error('图片地址', this.url);
})
this.$nextTick(() => {