增加新系统跳转老系统地图

dev
LiuJiaNan 2025-02-25 10:53:38 +08:00
parent dc45aaa786
commit 90ae203db2
2 changed files with 34 additions and 1 deletions

View File

@ -48,7 +48,11 @@ router.beforeEach((to, from, next) => {
if (to.path == `/login` || to.path == '/apiBI' || to.path == '/apivideomanager') { if (to.path == `/login` || to.path == '/apiBI' || to.path == '/apivideomanager') {
next() next()
} else { } else {
next(`/login`) if (to.path == '/map' && to.query.userId) {
next()
} else {
next(`/login`)
}
} }
} }
}) })

View File

@ -1259,6 +1259,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.initUser()
this.initMap() this.initMap()
this.pointBoxCfd = loadMapBoxCfd() this.pointBoxCfd = loadMapBoxCfd()
this.pointBoxCmt = loadCmtMapBox() this.pointBoxCmt = loadCmtMapBox()
@ -1362,6 +1363,23 @@ export default {
// }) // })
// }) // })
// }, // },
initUser() {
const { userId } = this.$route.query
if (!userId) return
requestFN(
'/admin/v2/login',
{ userId }
).then((res) => {
console.log(res)
if (res.result !== 'success') {
alert('登录失败')
window.close()
}
}).catch((e) => {
alert('登录失败')
window.close()
})
},
initMap() { initMap() {
viewer = new Cesium.Viewer('cesiumContainer', { viewer = new Cesium.Viewer('cesiumContainer', {
// terrainProvider: Cesium.createWorldTerrain() // terrainProvider: Cesium.createWorldTerrain()
@ -1425,6 +1443,13 @@ export default {
// } // }
// } // }
// }, 1000) // }, 1000)
const { id, longitude, latitude, CORP_INFO_ID, type } = this.$route.query
if (type === 'newToOld') {
setTimeout(() => {
this.clickPort({ id, longitude, latitude, height: 10000, CORP_INFO_ID })
}, 1000)
}
}, },
loadTilesetHandler() { loadTilesetHandler() {
@ -1962,6 +1987,10 @@ export default {
handleClickRightTools(index) { handleClickRightTools(index) {
if (this.rightOptionsList[index].check !== '') this.rightOptionsList[index].check = !this.rightOptionsList[index].check if (this.rightOptionsList[index].check !== '') this.rightOptionsList[index].check = !this.rightOptionsList[index].check
if (index === 0) { if (index === 0) {
if (this.$route.query.userId) {
window.close()
return
}
if (this.gangkouActive === '00004') { if (this.gangkouActive === '00004') {
// if (this.fwebsocket) { // if (this.fwebsocket) {
// this.fwebsocket.close() // this.fwebsocket.close()