yusheng 2 月之前
父節點
當前提交
ab085bc02a
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/views/doc/components/browse.vue

+ 6 - 1
src/views/doc/components/browse.vue

@@ -58,7 +58,12 @@
         var iframe = document.getElementById('Iframe');
         var iframeDocument = iframe.contentWindow.document;
         var container = iframeDocument.querySelectorAll('.container');
-        this.$refs.aa.init(container[0].innerHTML);
+        this.$refs.aa.init(
+          container[0].innerHTML.replace(
+            /src="https?:\/\/[^\/]+(\/[^"]*)"/g,
+            `src="${window.location.origin}$1"`
+          )
+        );
       },
       setFileUrl(row) {
         this.loading = true;