@lark-apaas/devtool-kits 1.0.6 → 1.0.7-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/error.html +11 -11
- package/package.json +1 -1
package/dist/error.html
CHANGED
|
@@ -277,23 +277,23 @@
|
|
|
277
277
|
// 发送 postMessage
|
|
278
278
|
function sendPostMessage(message, targetOrigin) {
|
|
279
279
|
const origin = targetOrigin || getPreviewParentOrigin();
|
|
280
|
+
console.log('sendPostMessage', message, origin);
|
|
280
281
|
window.parent.postMessage(message, origin);
|
|
281
282
|
}
|
|
282
283
|
|
|
283
284
|
// 获取父窗口 origin
|
|
284
285
|
function getPreviewParentOrigin() {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return url.origin;
|
|
290
|
-
} catch (e) {
|
|
291
|
-
console.error('解析 referrer 失败:', e);
|
|
292
|
-
}
|
|
286
|
+
const { origin } = window.location;
|
|
287
|
+
// 线上环境
|
|
288
|
+
if (origin.includes('feishuapp.cn') || origin.includes('miaoda.feishuapp.net')) {
|
|
289
|
+
return 'https://miaoda.feishu.cn';
|
|
293
290
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
291
|
+
// PRE 环境
|
|
292
|
+
if (origin.includes('fsapp.kundou.cn') || origin.includes('miaoda-pre.feishuapp.net')) {
|
|
293
|
+
return 'https://miaoda.feishu-pre.cn';
|
|
294
|
+
}
|
|
295
|
+
// BOE 环境
|
|
296
|
+
return 'https://miaoda.feishu-boe.cn';
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
// 复制到剪贴板
|