Quellcode durchsuchen

修复`iframe`跨域情况下页面不显示的问题

mxd vor 3 Jahren
Ursprung
Commit
e8db209913
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5 2
      magic-editor/src/console/src/App.vue

+ 5 - 2
magic-editor/src/console/src/App.vue

@@ -14,8 +14,11 @@ export default {
   },
   data() {
     let defaultConfig = {};
-    if (parent && parent.MAGIC_EDITOR_CONFIG) {
-      defaultConfig = {...parent.MAGIC_EDITOR_CONFIG};
+    try {
+      if (parent && parent.MAGIC_EDITOR_CONFIG) {
+        defaultConfig = {...parent.MAGIC_EDITOR_CONFIG};
+      }
+    } catch (ignored) {
     }
     if (window.MAGIC_EDITOR_CONFIG) {
       defaultConfig = {...defaultConfig, ...window.MAGIC_EDITOR_CONFIG}