Commit 674ef258 by yangliang

优化水印方法

parent 4efe85bd
......@@ -111,14 +111,27 @@ function watermark(settings) {
};
document.body.appendChild(oTemp);
}
function getSy(ips){debugger
var sfzh = $('#sfzh').html();
if(sfzh.length>=18){
sfzh = sfzh.substring(0,6)+"****"+sfzh.substring(14,18)
function getSy(){
debugger
if(!getIP_flag){
setTimeout(function(){
var sfzh = $('#sfzh').html();
if(sfzh.length>=18){
sfzh = sfzh.substring(0,6)+"****"+sfzh.substring(14,18)
}
var thisDate = getNowFormatDate();
var sy=sfzh+" "+$('#yhm').html()+" "+thisDate+" "+iptemp+" 协同办案"+" "+$('#yhdw').html();
watermark({watermark_txt: sy});
}, 1000);
}else{
var sfzh = $('#sfzh').html();
if(sfzh.length>=18){
sfzh = sfzh.substring(0,6)+"****"+sfzh.substring(14,18)
}
var thisDate = getNowFormatDate();
var sy=sfzh+" "+$('#yhm').html()+" "+thisDate+" "+iptemp+" 协同办案"+" "+$('#yhdw').html();
watermark({watermark_txt: sy});
}
var thisDate = getNowFormatDate();
var sy=sfzh+" "+$('#yhm').html()+" "+thisDate+" "+ips+" 协同办案"+" "+$('#yhdw').html();
watermark({watermark_txt: sy});
}
function getNowFormatDate() {
......@@ -141,10 +154,8 @@ function getNowFormatDate() {
}
var getIP_flag = false;
var iptemp = "";
function getIPs(callback){
try{
var ip_dups = {};
//compatibility for firefox and chrome
var RTCPeerConnection = window.RTCPeerConnection
......@@ -218,25 +229,18 @@ function getIPs(callback){
handleCandidate(line);
});
}, 500);
}catch (e) {
//getSy("");
}finally{
setTimeout(function(){
if(!getIP_flag){
getSy(iptemp);
}
}, 1000);
}
}
//insert IP addresses into the page
var iptemp = "";
getIPs(function(ip){
debugger;
if(ip!=null&&ip!=""&&ip!=undefined&&ip!="undefined"){
iptemp = ip;
}
getIP_flag = true;
getSy(iptemp);
getIP_flag = true;
//var iptmp = $("#ipflag").html();
//if(iptmp==1||iptmp==2){
// getSy();
// }
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment