fix(嵌入式): iframe嵌入-编辑移动端页面报 iframe 嵌入式域名匹配错误

This commit is contained in:
dataeaseShu 2024-05-10 16:54:48 +08:00
parent d2a5045784
commit 977d452544

View File

@ -70,13 +70,16 @@ const componentDataNotInMobile = computed(() => {
const newWindow = ref()
const hanedleMessage = event => {
if (event.data?.msgOrigin === 'de-fit2cloud' && !!embeddedStore.token) {
if (
event.data?.msgOrigin === 'de-fit2cloud' &&
!!embeddedStore.token &&
!!embeddedStore.baseUrl
) {
const params = {
embeddedToken: embeddedStore.token
}
params['de-embedded'] = true
const contentWindow = newWindow.value.contentWindow
console.log('call back from dataease!', contentWindow)
contentWindow.postMessage(params, '*')
return
}