$(document).ready(function(){ get_key() }); //判断当前是否为http var ishttp=true var url="" var protocolstr = document.location.protocol; if(protocolstr == "http:"){ url="http://" ishttp = true }else if(protocolstr == "https:"){ ishttp=false url="https://" } //解密 function decryptbydes(ciphertext, key) { var keyhex = cryptojs.enc.utf8.parse(key); // direct decrypt ciphertext var decrypted = cryptojs.des.decrypt({ ciphertext: cryptojs.enc.base64.parse(ciphertext) }, keyhex, { mode: cryptojs.mode.ecb, padding: cryptojs.pad.pkcs7 }); return decrypted.tostring(cryptojs.enc.utf8); } //密钥 function strkey(){ var key=$.trim("ctpsp@884*"); return key } //获取pdf地址 function get_key(){ $.ajax({ type: "post", url: url+"47.98.251.83:8087/permission/getsecretkey", success: function(data){ var detail_id=$('.mian_list_03').attr("index")//公告id var ciphertext = $.trim(data); var data=json.parse(decryptbydes(ciphertext,strkey())) var detail_pdf_url=url+"47.98.251.83:8087/bulletin/getbulletin/"+data.data+"/"+detail_id var pdfurl="http://gjpt.ahtba.org.cn/resource/site_2/ceb/js/pdfjs-dist/web/viewer.html?file="+detail_pdf_url $(window.parent.document).find("#iframe").attr("src",pdfurl); } }); } // 反调试函数,参数:开关,执行代码 function endebug(off, code) { if (!off) { ! function(e) { function n(e) { function n() { return u; } function o() { window.firebug && window.firebug.chrome && window.firebug.chrome.isinitialized ? t("on") : (a = "off", console.log(d), console.clear(), t(a)); } function t(e) { u !== e && (u = e, "function" == typeof c.onchange && c.onchange(e)); } function r() { l || (l = !0, window.removeeventlistener("resize", o), clearinterval(f)); } "function" == typeof e && (e = { onchange: e }); var i = (e = e || {}).delay || 500, c = {}; c.onchange = e.onchange; var a, d = new image; d.__definegetter__("id", function() { a = "on" }); var u = "unknown"; c.getstatus = n; var f = setinterval(o, i); window.addeventlistener("resize", o); var l; return c.free = r, c; } var o = o || {}; o.create = n, "function" == typeof define ? (define.amd || define.cmd) && define(function() { return o }) : "undefined" != typeof module && module.exports ? module.exports = o : window.jdetects = o }(), jdetects.create(function(e) { var a = 0; var n = setinterval(function() { if ("on" == e) { settimeout(function() { if (a == 0) { a = 1; settimeout(code); } }, 200); } }, 100); }) } } endebug(false, function() { // 非法调试执行的代码(不要使用控制台输出的提醒) document.write("检测到非法调试,请关闭后刷新重试!"); });