ofd和tiff下载跨域文件接口修改
parent
167189d4e4
commit
3dcd183171
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue