Эх сурвалжийг харах

ofd和tiff下载跨域文件接口修改

陈精华 2 жил өмнө
parent
commit
3dcd183171

+ 1 - 1
server/src/main/resources/web/ofd.ftl

@@ -15,7 +15,7 @@
     var url = '${currentUrl}';
     var baseUrl = '${baseUrl}'.endsWith('/') ? '${baseUrl}' : '${baseUrl}' + '/';
     if (!url.startsWith(baseUrl)) {
-        url = baseUrl + 'getCorsFile?urlPath=' + encodeURIComponent(url);
+        url = baseUrl + 'getCorsFile?urlPath=' + encodeURIComponent(Base64.encode(url));
     }
     document.getElementsByTagName('iframe')[0].src = "${baseUrl}ofd/index.html?file="+ encodeURIComponent(url)+"";
     document.getElementsByTagName('iframe')[0].height = document.documentElement.clientHeight - 10;

+ 1 - 12
server/src/main/resources/web/tiff.ftl

@@ -58,17 +58,6 @@
         loadOne();
     }
 
-    function doPrint() {
-        bdhtml=window.document.body.innerHTML;
-        sprnstr="<!--startprint-->";
-        eprnstr="<!--endprint-->";
-        prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
-        prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
-        window.document.body.innerHTML=prnhtml;
-        initWaterMark();
-        window.print();
-    }
-
     String.prototype.startsWithh = function(str) {
         var reg = new RegExp("^" + str);
         return reg.test(this);
@@ -82,7 +71,7 @@
     var url = '${finalUrl}';
     var baseUrl = '${baseUrl}'.endsWithh('/') ? '${baseUrl}' : '${baseUrl}' + '/';
     if (!url.startsWithh(baseUrl)) {
-        url = baseUrl + 'getCorsFile?urlPath=' + encodeURIComponent(url);
+        url = baseUrl + 'getCorsFile?urlPath=' + encodeURIComponent(Base64.encode(url));
     }
     const xhr = new XMLHttpRequest();
     xhr.open('GET', url);