@lark-apaas/devtool-kits 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/dist/error.html +11 -11
  2. 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
- // 优先使用 document.referrer
286
- if (document.referrer) {
287
- try {
288
- const url = new URL(document.referrer);
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
- return '*';
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
  // 复制到剪贴板
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/devtool-kits",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "FullStack Devtool Kits",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",