增加新系统跳转老系统地

dev
LiuJiaNan 2025-02-25 11:05:03 +08:00
parent cd9590fe09
commit 1a0f8011f8
2 changed files with 27 additions and 1 deletions

View File

@ -45,10 +45,14 @@ router.beforeEach((to, from, next) => {
} else {
if (to.path == `/login` || to.path == '/apiMonitoringCenter' || to.path == '/apiMajorHazardSources') {
next()
} else {
if (to.path == '/map' && to.query.userId) {
next()
} else {
next(`/login`)
}
}
}
})
function formatRoutes(routes, baseUrl) {

View File

@ -1614,6 +1614,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.timer) {
clearInterval(this.timer)
@ -2922,10 +2926,28 @@ export default {
this.corpInfo.CORP_INFO_ID = data.info.CORP_INFO_ID
this.corpInfo.latitude = data.info.latitude
this.corpInfo.longitude = data.info.longitude
this.initUser()
this.initMap()
}).catch((e) => {
console.log(e)
})
},
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()
})
}
}
}