mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 10:58:44 +08:00
Update jd_try.js
This commit is contained in:
parent
f453d5923c
commit
88d89a4f91
14
jd_try.js
14
jd_try.js
@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* 2022-07-20 修复获取试用列表风控问题;
|
* 2022-07-20 修复获取试用列表风控问题;
|
||||||
* 2022-08-12 修复申请试用风控,更换nolan接口
|
* 2022-08-12 修复申请试用风控,更换nolan接口
|
||||||
|
* 2022-9-5 某个商品timeout继续下一个不中断
|
||||||
* By https://github.com/6dylan6/jdpro/
|
* By https://github.com/6dylan6/jdpro/
|
||||||
* 基于X1a0He版本修改
|
* 基于X1a0He版本修改
|
||||||
* @Address: https://github.com/X1a0He/jd_scripts_fixed/blob/main/jd_try_xh.js
|
* @Address: https://github.com/X1a0He/jd_scripts_fixed/blob/main/jd_try_xh.js
|
||||||
@ -255,11 +256,11 @@ let args_xh = {
|
|||||||
await $.wait(2000);
|
await $.wait(2000);
|
||||||
for (let i = 0; i < trialActivityIdList.length && $.isLimit === false; i++) {
|
for (let i = 0; i < trialActivityIdList.length && $.isLimit === false; i++) {
|
||||||
if ($.isLimit) {
|
if ($.isLimit) {
|
||||||
console.log("试用上限")
|
console.log("试用上限");
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if ($.isForbidden) { console.log('403了,跳出'); break }
|
if ($.isForbidden) { console.log('403了,跳出'); break };
|
||||||
await try_apply(trialActivityTitleList[i], trialActivityIdList[i])
|
await try_apply(trialActivityTitleList[i], trialActivityIdList[i]);
|
||||||
//console.log(`间隔等待中,请等待 ${args_xh.applyInterval} ms\n`)
|
//console.log(`间隔等待中,请等待 ${args_xh.applyInterval} ms\n`)
|
||||||
const waitTime = generateRandomInteger(args_xh.applyInterval, 9000);
|
const waitTime = generateRandomInteger(args_xh.applyInterval, 9000);
|
||||||
console.log(`随机等待${waitTime}ms后继续`);
|
console.log(`随机等待${waitTime}ms后继续`);
|
||||||
@ -498,8 +499,7 @@ function try_feedsList(tabId, page) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function try_apply(title, activityId) {
|
async function try_apply(title, activityId) {
|
||||||
return new Promise(async (resolve, reject) => {
|
|
||||||
console.log(`申请试用商品提交中...`)
|
console.log(`申请试用商品提交中...`)
|
||||||
args_xh.printLog ? console.log(`商品:${title}`) : ''
|
args_xh.printLog ? console.log(`商品:${title}`) : ''
|
||||||
args_xh.printLog ? console.log(`id为:${activityId}`) : ''
|
args_xh.printLog ? console.log(`id为:${activityId}`) : ''
|
||||||
@ -523,6 +523,7 @@ function try_apply(title, activityId) {
|
|||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
$.get(opt, (err, resp, data) => {
|
$.get(opt, (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -738,12 +739,13 @@ function geth5st(body) {
|
|||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(JSON.stringify(err));
|
console.log(JSON.stringify(err));
|
||||||
|
console.log('连接服务失败\n');
|
||||||
} else {
|
} else {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
str = data.body;
|
str = data.body;
|
||||||
} else {
|
} else {
|
||||||
$.log('连接服务失败',data.msg);
|
$.log('获取失败',data.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user