Bläddra i källkod

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

mxd 3 år sedan
förälder
incheckning
e8db209913
1 ändrade filer med 5 tillägg och 2 borttagningar
  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}