0210
Some checks failed
test / Run tests (push) Failing after 13s
build / Build (push) Failing after 22s

This commit is contained in:
2025-02-10 18:10:50 +08:00
parent 1e8b5e6453
commit 36cf8ef5a7
11 changed files with 71 additions and 35 deletions

View File

@@ -23,6 +23,7 @@ export class WindowMessage implements Message {
) {
// 监听消息
this.source.addEventListener("message", (e) => {
console.log(e);
if (e.source === this.target || e.source === this.source) {
this.messageHandle(e.data);
}
@@ -35,6 +36,11 @@ export class WindowMessage implements Message {
// 接收到消息
this.EE.emit("message", data.data, (resp: any) => {
// 发送响应消息
// 无消息id则不发送响应消息
console.log("data", data, "resp", resp);
if (!data.messageId) {
return;
}
const body: WindowMessageBody = {
messageId: data.messageId,
type: "respMessage",