portraitMap.vue
1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<route lang="yaml">
# 组件名称
name: ""
</route>
<template>
<div class="container_wrap" v-loading="loading">
<iframe :src="link" frameborder="0" @load="iframeLoad"></iframe>
</div>
</template>
<script lang="ts" setup name="portraitMap">
import { ref, reactive, computed } from "vue";
import { JSEncrypt } from 'jsencrypt';
import useUserStore from '@/store/modules/user'
const route = useRoute()
const encryptor = new JSEncrypt()
const publicKey = '-----BEGIN PUBLIC KEY-----MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgFiv3Ko6rOBvWDK96tIExpdyuuQAGgZo0YmQxpT10hD3qu/MnNKlIJgo4+NwUHcwpleKE2DBOxgvCeMtUoP4FDWt8q18X+4+7t8p0D/57NhA0liNKQ/Ise6b5i293ht1XPen3XhR5xIcDNxauQ5vKqdwwzhoonsbJDtbowoinLQbAgMBAAE=-----END PUBLIC KEY-----';
function encrypt(txt) {
encryptor.setPublicKey(publicKey) // 设置公钥
return encryptor.encrypt(txt); // 对数据进行加密
}
const userStore = useUserStore()
const userInfoData = JSON.parse(localStorage.userData)
const url: any = 'https://scm-operation-test.csbr.cn/portraitBMap?fUrl=portraitMap';
// const url: any = 'http://localhost:8086/portraitBMap?fUrl=portraitMap';
const link = ref('')
const loading = ref(true);
const iframeLoad = () => {
loading.value = false;
}
// 搜索区域的schema
onBeforeMount(() => {
const loginInfo = JSON.stringify({
username: '13822222222',
pwd: '666666',
timestamp: new Date().getTime()
})
let linkValue = decodeURIComponent(url) + '&loginInfo=' + encodeURI(encrypt(loginInfo));
link.value = linkValue;
});
onActivated(() => {
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === route.fullPath);
if (tab) {
tab.meta.title = route.query.title || '全景地图';
}
})
</script>
<style lang="scss" scoped>
.container_wrap {
width: 100%;
height: 100%;
padding: 0;
iframe {
width: 100%;
height: 100%;
}
}
</style>