From 90ae203db22cddece7d90f7b52dad243db2c5434 Mon Sep 17 00:00:00 2001 From: LiuJiaNan Date: Tue, 25 Feb 2025 10:53:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E8=80=81=E7=B3=BB=E7=BB=9F=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/asyncRouter.js | 6 +++++- src/views/map/index.vue | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/asyncRouter.js b/src/asyncRouter.js index 7750987..d6ba197 100644 --- a/src/asyncRouter.js +++ b/src/asyncRouter.js @@ -48,7 +48,11 @@ router.beforeEach((to, from, next) => { if (to.path == `/login` || to.path == '/apiBI' || to.path == '/apivideomanager') { next() } else { - next(`/login`) + if (to.path == '/map' && to.query.userId) { + next() + } else { + next(`/login`) + } } } }) diff --git a/src/views/map/index.vue b/src/views/map/index.vue index 0d91fb9..7afe3d0 100644 --- a/src/views/map/index.vue +++ b/src/views/map/index.vue @@ -1259,6 +1259,7 @@ export default { } }, mounted() { + this.initUser() this.initMap() this.pointBoxCfd = loadMapBoxCfd() 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() { viewer = new Cesium.Viewer('cesiumContainer', { // terrainProvider: Cesium.createWorldTerrain() @@ -1425,6 +1443,13 @@ export default { // } // } // }, 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() { @@ -1962,6 +1987,10 @@ export default { handleClickRightTools(index) { if (this.rightOptionsList[index].check !== '') this.rightOptionsList[index].check = !this.rightOptionsList[index].check if (index === 0) { + if (this.$route.query.userId) { + window.close() + return + } if (this.gangkouActive === '00004') { // if (this.fwebsocket) { // this.fwebsocket.close()