[提示]
在研究过程中,发现登录是按时间段的,并且登录时会调用获取微信code进行校验,防止脱机使用,并且购买商品时同样也会获取code进行校验。这里我们已经给出了解决方案,有兴趣的可以一起交流。
下载
function sendtel(){
var tels = $("#tel").val();
if(tels){
console.log(tels);
}else{
alert("请输入手机号");
}
var strs= new Array(); //定义一数组
strs=tels.split("-"); //字符分割
var lis = '<li class="item" >'+'正在发送中请稍等'+'</li>';
for (i=0;i<strs.length ;i++ )
{
(function(i) {
setTimeout(function() {
var captchaId_k = "";
var locX_k = "";
var mobile = strs[i];
var path = "https://prod.ggszhg.com/xgt-app/applet/imgCaptcha/getImgCaptcha?os=APPLET&osVersion=1.0.0&userId=&userToken=&sign=9F00FD42321B5FB62FAA30E72D59DDB9";
$.ajax({
type: "post",
url: path,
async: false,
success: function(data) {
captchaId_k = data.data.captchaId;
locX_k = data.data.locX;
}
});
if(!captchaId_k){
alert("坐标出现错误");
return;
}
showtmpl2(captchaId_k,locX_k)
var codes;
codes = showtmpl3(mobile,captchaId_k);
console.log("code="+codes)
if(codes == 200){
lis += '<li class="item" >'+'手机号'+mobile+'发送成功,注意查收'+'</li>';
}else{
lis += '<li class="item" >'+'手机号'+mobile+'发送失败,原因未注册或者平台发送问题'+'</li>';
console.log("11111="+lis);
}
$('#content').append(lis);
}, (i + 1) * 15000);
})(i)
$('#content').append(lis);
}
}
function showtmpl3(mobile,captchaId_k) {
var n= {"mobile":mobile,"type":"LOGIN_CONFIRMATION","captchaId":captchaId_k};
console.log("si++==captchaId_k=="+captchaId_k);
var newsign = sign(n);
var signs = $.md5(newsign).toUpperCase();
var path = "https://prod.ggszhg.com/xgt-app/applet/personalCenter/sendToMobile?os=APPLET&osVersion=1.0.0&userId=&userToken=&sign="+signs;
var codes;
$.ajax({
type: "post",
url: path,
dataType: 'json',
processData: false,
contentType: 'application/json;charset=UTF-8',
data: JSON.stringify({ mobile: mobile,type: "LOGIN_CONFIRMATION",captchaId:captchaId_k}),
async: false,
success: function(data) {
console.log(data);
if(data.code ==200 ){
codes= 200;
}else{
codes= 302;
}
}
});
return codes;
}