!209 第三方应用open预览地址的时候,发现window.opener并不是一个window对象会报addEventListener不存在。

Merge pull request !209 from 空/N/A
This commit is contained in:
奔跑的面条 2023-09-16 08:09:10 +00:00 committed by Gitee
commit 6e55c9951b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -16,6 +16,7 @@ let key = ref(Date.now())
// ->
;[SavePageEnum.JSON, SavePageEnum.CHART_TO_PREVIEW].forEach((saveEvent: string) => {
if (!window.opener) return
if(!(window.opener === window)) return
window.opener.addEventListener(saveEvent, async (e: any) => {
const localStorageInfo: ChartEditStorageType = await getSessionStorageInfo() as unknown as ChartEditStorageType
setSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST, [{ ...e.detail, id: localStorageInfo.id }])