|
发表于 2019-1-8 20:18:51
|
显示全部楼层
江苏省苏州市
function getwweicode(imgdata){ // imgdata = base64_encode_image('./qrcode.jpg');//本地图片
isfromwwei = 1;
//config
var api_id = 'qr241778';
var api_key = '20171027135609';
var timestamp = get_timestamp();
var client = hprose.Client.create('https://rpcapi.wwei.cn/qrcode.html', ['qrencode','qrdecode']);
var imgurl = '';//远程图片
//var imgdata ='';// base64_encode_image('./qrcode.jpg');//本地图片
var signature = md5(api_key + timestamp + imgurl + imgdata);
client.ready(function(qrcode) {
qrcode.qrdecode(api_id,signature,timestamp,imgurl,imgdata)
.then(function(result) {
if(result.status !=1){
toastr.error("二维码无法识别,请换一张");
currentimg = currentimg + 1;
if (currentimg < totalimg){
multipleUpload();
}else{
setTimeout(function(){
location.reload();
}, 2000);
}
}
//成功
read(result.data.raw_text);
},function(e) {
toastr.error("二维码无法识别:" + e);
currentimg = currentimg + 1;
if (currentimg < totalimg){
multipleUpload();
}else{
setTimeout(function(){
location.reload();
}, 2000);
}
});
});
} |
评分
-
参与人数 1 | 荣誉 +1 |
收起
理由
|
笨潴
| + 1 |
热心帮助他人,荣誉+1,希望继续努力(*^__^*) 嘻嘻! |
查看全部评分
|