zhangjie 6 달 전
부모
커밋
7e43d833a8
2개의 변경된 파일10개의 추가작업 그리고 9개의 파일을 삭제
  1. 1 1
      public/index.html
  2. 9 8
      src/plugins/imageExport.js

+ 1 - 1
public/index.html

@@ -8,7 +8,7 @@
   <meta name="renderer" content="webkit|ie-comp|ie-stand" />
   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
   <meta http-equiv="Content-Security-Policy"
-    content="script-src 'self' 'unsafe-inline' 'unsafe-eval';  frame-src 'self' 'blob';" />
+    content="script-src 'self' 'unsafe-inline' 'unsafe-eval'; " />
   <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
   <title>知学知考</title>
 </head>

+ 9 - 8
src/plugins/imageExport.js

@@ -33,15 +33,16 @@ export function getDownloadURLScheme(downloadSet = null, apiUrl = null) {
 }
 
 export function openApp(scheme) {
-  // 创建 iframe 来尝试调用 URL Scheme
-  const iframe = document.createElement("iframe");
-  iframe.style.display = "none";
-  iframe.src = scheme;
-  document.body.appendChild(iframe);
+  window.location.href = scheme;
+  // // 创建 iframe 来尝试调用 URL Scheme
+  // const iframe = document.createElement("iframe");
+  // iframe.style.display = "none";
+  // iframe.src = scheme;
+  // document.body.appendChild(iframe);
 
-  setTimeout(() => {
-    document.body.removeChild(iframe);
-  }, 1000);
+  // setTimeout(() => {
+  //   document.body.removeChild(iframe);
+  // }, 1000);
 }
 
 export function openAppWithCallback(scheme, timeout = 2000, fallback) {