退出登录事件
组态监听母页面发送的退出登录事件,执行退出智能设施云平台
- 关联组件
不涉及
- 事件格式:
{
"direction": "import",
"type": "bastudioLogout"
}
- 参数说明:
type:消息类型(bastudioLogout为退出登录)
- 处理样例
假设在母页面中将嵌入的组态iframe页面id定义为BaPage,该母页面可通过调用postMessage的方法给组态页面发送消息,发送该事件代码示例,参考如下:
let iframeEl = document.getElementById("BaPage");
iframeEl.contentWindow.postMessage(
{
direction: "import",
type: "bastudioLogout"
},
"http://localhost:8082"
);
其中:'http://localhost:8082':iframe子页面域名,是由组态页面来监听该事件(解决iframe父子页面域名不一样时出现的跨域问题)。