From 5aa27e106839249524ef54a34479ab900c794584 Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Wed, 17 Aug 2022 15:12:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(BIM?= =?UTF-8?q?=E4=B8=AD=E5=BF=83)=EF=BC=9A=E5=AE=8C=E6=88=90=E5=8A=A8?= =?UTF-8?q?=E6=80=81=20BIM=20=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/bim.html | 13 ++++++++----- src/views/projectAdmin/jlw/CIM/index.vue | 3 +-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/public/bim.html b/public/bim.html index d09b3bb6..d8271eea 100644 --- a/public/bim.html +++ b/public/bim.html @@ -30,11 +30,14 @@ } window.addEventListener('message', function(e) { - console.log(e.data, '父级页面传来的数据') - // bimCallback(e.data) - setTimeout(() => { - window.parent.postMessage({ msg: 'hello' }) - }, 2000) + const data = e.data || {} + if (data.token) { + bimCallback(data.token) + } + // console.log(e.data, '父级页面传来的数据') + // setTimeout(() => { + // window.parent.postMessage({ msg: 'hello' }) + // }, 2000) }) diff --git a/src/views/projectAdmin/jlw/CIM/index.vue b/src/views/projectAdmin/jlw/CIM/index.vue index d8357609..ff5fda6d 100644 --- a/src/views/projectAdmin/jlw/CIM/index.vue +++ b/src/views/projectAdmin/jlw/CIM/index.vue @@ -59,7 +59,6 @@ export default { this.buildList = res.result.page.records res.result.page.records.forEach(item => { if (item.isEnable) { - // this.iframe.contentWindow.postMessage({ fileId: item.fileId }) this.getToken(item.fileId) } }) @@ -68,7 +67,7 @@ export default { getToken(fileId) { getJlwTokenApi({ fileId, projectSn: this.$store.state.projectSn }).then(res => { const token = res.result - console.log('token', token) + this.iframe.contentWindow.postMessage({ token }) }) } }