1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <meta http-equiv="pragma" content="no-cache" />
- <meta http-equiv="content-type" content="no-cache, must-revalidate" />
- <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT" />
- <title></title>
- <script>document.write("<link href='AFrontEnd/css/special.css?time=" + new Date().getTime() + "' rel='stylesheet'>");</script>
- <script src="AFrontEnd/js/jquery/jquery-1.8.3.min.js"></script>
- <script src="apiurljs.js"></script>
- </head>
- <body>
- <button class="sp-btn-blue sp-pull-right" onclick="window.open(ipChange(url))">下载</button>
- <button class="sp-btn-blue sp-pull-right pc" style="display:none" onclick="javascript: window.close();">
- 关 闭
- </button>
- <button class="sp-btn-blue sp-pull-right pad" style="display:none" onclick="javascript: history.go(-1);">
- 关 闭
- </button>
- <iframe id="printPreview"></iframe>
- <script>
- if (localStorage.getItem("tjJxtGoldenlinkWork-deviceType") != "pad") {
- $(".pc").show()
- } else {
- $(".pad").show()
- }
- function ipChange(ip) {
- return window.location.origin + ip.slice(7).slice(ip.slice(7).indexOf("/"))
- }
- var params = "?" + location.search
- var url = params.match(new RegExp("[\?\&]url=([^\&]+)", "i"))[1];
- if (url.indexOf("doc") != -1) {
- set_convertType = 0;
- } else if (url.indexOf("pdf") != -1) {
- set_convertType = 20;
- } else if (url.indexOf("ofd") != -1) {
- set_convertType = 570;
- } else {
- set_convertType = 0;
- }
- $.ajax({
- url: apiurljs.login.split("glwork")[0] + "fcscloud/composite/httpfile",
- type: "post",
- dataType: 'json',
- contentType: "application/x-www-form-urlencoded",
- data: {
- convertType: set_convertType,
- fileUrl: url,
- isPrint: 1,
- isDownload: 1
- },
- success: function (res) {
- if (res.errorcode === 0) {
- let rst = res.data;
- console.log("原输出地址:" + rst.viewUrl)
- $("#printPreview").css("width", $(window).width()).css("height", $(window).height())
- $("#printPreview").attr("src", ipChange(rst.viewUrl))
- console.log("IP替换地址:" + ipChange(rst.viewUrl))
- if (ipChange(rst.viewUrl).indexOf(window.location.origin) == -1) {
- console.log("请您清除浏览器缓存后重试!")
- }
- } else {
- console.log(res.message);
- }
- }
- })
- </script>
- </body>
- </html>
|