$("head").append(""); $("head").children(":last").attr({ rel: "stylesheet", type: "text/css", href: getRootPath_web()+"/comm/css/code.css" }); var loginQRCode = function(target,width,height,colorDark,colorLight){ this.target = target; this.width = (width == null)? 128:width; this.height = (height == null)? 128:height; this.colorDark = (colorDark == null)? "#000000":colorDark; this.colorLight = (colorLight == null)? "#ffffff":colorLight; this.int = null; }; loginQRCode.prototype.generateUUID = function() { var d = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = (d + Math.random()*16)%16 | 0; d = Math.floor(d/16); return (c=='x' ? r : (r&0x3|0x8)).toString(16); }); return uuid; }; loginQRCode.prototype.generateLoginQRCode = function(callback){ var obj = this; var uuid = this.generateUUID(); var target = this.target; var width = this.width; var height = this.height; var qrcode = new QRCode(document.getElementById(target), { width: this.width, height: this.height, colorDark : this.colorDark, colorLight : this.colorLight, correctLevel : QRCode.CorrectLevel.L }); qrcode.makeCode(getRootPath_web()+"/"+"appLogin?uuid=" + uuid+"&service="+getQueryString("service")); console.log(getRootPath_web()+"/"+"appLogin?uuid=" + uuid+"&service="+getQueryString("service")); var timesRun = 0; var interval = setInterval(function(){ timesRun += 1; if(timesRun === 60){ clearInterval(interval); $("#"+target).addClass("code-box"); $("#"+target).append("
二维码已失效
" + "" + "