代码拉取完成,页面将自动刷新
getPictrue({captchaType:"blockPuzzle", clientUid: localStorage.getItem('slider'), ts: Date.now()},this.options.baseUrl,function (res) {
if (res.repCode==="0000") {
_this.$element.find(".backImg")[0].src = 'data:image/png;base64,'+res.repData.originalImageBase64
_this.$element.find(".bock-backImg")[0].src = 'data:image/png;base64,'+res.repData.jigsawImageBase64
_this.secretKey = res.repData.secretKey
_this.backToken = res.repData.token
} else {
_this.$element.find(".backImg")[0].src = 'images/default.jpg'
_this.$element.find(".bock-backImg")[0].src = ''
_this.htmlDoms.tips.addClass('err-bg').removeClass('suc-bg')
_this.htmlDoms.tips.animate({"bottom":"0px"});
_this.htmlDoms.tips.text(res.repMsg)
setTimeout(function () {
_this.htmlDoms.tips.animate({"bottom":"-35px"});
}, 1000);
}
});
function getPictrue(data,baseUrl,resolve,reject){
$.ajax({
type : "post",
contentType: "application/json;charset=UTF-8",
url : baseUrl + "/captcha/get",
data :JSON.stringify(data),
cache: false,
crossDomain: true == !(document.all),
success:function(res){
resolve(res);
},
fail: function(err) {
reject(err);
}
});