Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
KingRan888 committed Jul 19, 2022
1 parent cc5df06 commit 78e4bdc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
File renamed without changes.
10 changes: 6 additions & 4 deletions jd_plantBean.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ function requireConfig() {
}
function requestGet(function_id, body = {}) {
if (!body.version) {
body["version"] = "9.0.0.1";
body["version"] = "9.2.4.1";
}
body["monitor_source"] = "plant_app_plant_index";
body["monitor_refer"] = "";
Expand Down Expand Up @@ -776,15 +776,17 @@ function request(function_id, body = {}){
function taskUrl(function_id, body) {
body["version"] = "9.2.4.1";
body["monitor_source"] = "plant_app_plant_index";
if (!body["monitor_refer"]){
body["monitor_refer"] = "";
}
return {
url: JD_API_HOST,
body: `functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld&client=apple&area=19_1601_50258_51885&build=167490&clientVersion=9.3.2`,
body: `functionId=${function_id}&body=${encodeURIComponent(JSON.stringify(body))}&appid=ld&client=apple&area=19_1601_50258_51885&build=167490&clientVersion=9.3.2`,
headers: {
"Cookie": cookie,
"Host": "api.m.jd.com",
//"Host": "api.m.jd.com",
"Accept": "*/*",
"Connection": "keep-alive",
//"Connection": "keep-alive",
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
"Accept-Language": "zh-Hans-CN;q=1,en-CN;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
Expand Down
14 changes: 8 additions & 6 deletions jd_plantBean_help.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ async function plantBeanIndex() {
}
function requestGet(function_id, body = {}) {
if (!body.version) {
body["version"] = "9.0.0.1";
body["version"] = "9.2.4.1";
}
body["monitor_source"] = "plant_app_plant_index";
body["monitor_refer"] = "";
Expand Down Expand Up @@ -453,23 +453,25 @@ function request(function_id, body = {}) {
})
}
function taskUrl(function_id, body) {
body["version"] = "9.2.4.0";
body["version"] = "9.2.4.1";
body["monitor_source"] = "plant_app_plant_index";
if (!body["monitor_refer"]){
body["monitor_refer"] = "";
}
return {
url: JD_API_HOST,
body: `functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld&client=apple&area=19_1601_50258_51885&build=167490&clientVersion=9.3.2`,
body: `functionId=${function_id}&body=${encodeURIComponent(JSON.stringify(body))}&appid=ld&client=apple&area=19_1601_50258_51885&build=167490&clientVersion=9.3.2`,
headers: {
"Cookie": cookie,
"Host": "api.m.jd.com",
//"Host": "api.m.jd.com",
"Accept": "*/*",
"Connection": "keep-alive",
//"Connection": "keep-alive",
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
"Accept-Language": "zh-Hans-CN;q=1,en-CN;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"Content-Type": "application/x-www-form-urlencoded"
},
timeout: 10000,
timeout: 20000,
}
}
function getParam(url, name) {
Expand Down
9 changes: 5 additions & 4 deletions jd_superBrand.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ async function main() {
$.runFlag = false;
$.activityInfo = {};
await takeRequest('superBrandSecondFloorMainPage');
if(JSON.stringify($.activityInfo) === '{}'){
console.log(`获取活动详情失败`);
if($.bizCode == 'MP001'){
console.log(`本期活动结束,期待下期。。。`);
$.flag = true
return ;
}
Expand Down Expand Up @@ -120,13 +120,13 @@ async function doTask(){
console.log(`任务:${$.oneTask.assignmentName},已完成`);
continue;
}
if($.oneTask.assignmentType === 3 || $.oneTask.assignmentType === 0 || $.oneTask.assignmentType === 1 || $.oneTask.assignmentType === 7){
if($.oneTask.assignmentType === 3 || $.oneTask.assignmentType === 7 || $.oneTask.assignmentType === 1){ //7是开卡 3是关注店铺 1是浏览会场
if($.oneTask.assignmentType === 7){
console.log(`任务:${$.oneTask.assignmentName},尝试领取开卡奖励;(不会自动开卡,如果你已经是会员,则会领取成功)`);
}else{
console.log(`任务:${$.oneTask.assignmentName},去执行`);
}
let subInfo = $.oneTask.ext.followShop || $.oneTask.ext.brandMemberList || $.oneTask.ext.shoppingActivity ||'';
let subInfo = $.oneTask.ext.followShop || $.oneTask.ext.brandMemberList || $.oneTask.ext.shoppingActivity;
if(subInfo && subInfo[0]){
$.runInfo = subInfo[0];
}else{
Expand Down Expand Up @@ -216,6 +216,7 @@ function dealReturn(type, data) {
}
switch (type) {
case 'superBrandSecondFloorMainPage':
$.bizCode = data.data.bizCode;
if(data.code === '0' && data.data && data.data.result){
$.activityInfo = data.data.result;
}
Expand Down
2 changes: 1 addition & 1 deletion jd_superBrandJK.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $.flag = false
async function main(_0x14f2ac){
let _0xc6f9d4=decodeURIComponent(_0x14f2ac.match(/pt_pin=(.+?);/)&&_0x14f2ac.match(/pt_pin=(.+?);/)[1]);
let _0x43a9de=await takeRequest(_0x14f2ac,'showSecondFloorCardInfo','{"source":"card"}');
if(JSON.stringify(_0x43a9de)==='{}'||!_0x43a9de||!_0x43a9de.result||!_0x43a9de.result.activityBaseInfo){
if(_0x43a9de.bizCode == 'MP001'){
console.log('本期活动结束,等待下期。。。');
$.flag = true
return;
Expand Down
3 changes: 2 additions & 1 deletion jd_superBrandStar.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function main() {
$.runFlag = false;
$.activityInfo = {};
await takeRequest('showStarGiftInfo');
if (JSON.stringify($.activityInfo) === '{}') {
if($.bizCode == 'MP001'){
console.log(`本期活动结束,等待下期。。。`);
$.flag = true
return;
Expand Down Expand Up @@ -161,6 +161,7 @@ function dealReturn(type, data) {
}
switch (type) {
case 'showStarGiftInfo':
$.bizCode = data.data.bizCode;
if (data.code === '0' && data.data && data.data.result) {
$.activityInfo = data.data.result;
}
Expand Down

0 comments on commit 78e4bdc

Please sign in to comment.