mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-28 22:08:45 +08:00
Update jd_get_share_code.js
This commit is contained in:
parent
cc5acfb7f3
commit
8c5e439908
@ -61,114 +61,6 @@ if ($.isNode()) {
|
||||
.finally(() => {
|
||||
$.done();
|
||||
})
|
||||
function getJdFactory() {
|
||||
return new Promise(resolve => {
|
||||
$.post(
|
||||
taskPostUrl("jdfactory_getTaskDetail", {}, "jdfactory_getTaskDetail"),
|
||||
async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`);
|
||||
console.log(`$东东工厂 API请求失败,请检查网路重试`);
|
||||
} else {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
if (data.data.bizCode === 0) {
|
||||
$.taskVos = data.data.result.taskVos; //任务列表
|
||||
$.taskVos.map((item) => {
|
||||
if (item.taskType === 14) {
|
||||
console.log(
|
||||
`【京东账号${$.index}(${$.UserName})东东工厂】${item.assistTaskDetailVo.taskToken}`
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp);
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
);
|
||||
})
|
||||
}
|
||||
function getJxFactory(){
|
||||
const JX_API_HOST = "https://m.jingxi.com";
|
||||
|
||||
function JXGC_taskurl(functionId, body = "") {
|
||||
return {
|
||||
url: `${JX_API_HOST}/dreamfactory/${functionId}?zone=dream_factory&${body}&sceneval=2&g_login_type=1&_time=${Date.now()}&_=${Date.now()}`,
|
||||
headers: {
|
||||
Cookie: cookie,
|
||||
Host: "m.jingxi.com",
|
||||
Accept: "*/*",
|
||||
Connection: "keep-alive",
|
||||
"User-Agent":
|
||||
"jdpingou;iPhone;3.14.4;14.0;ae75259f6ca8378672006fc41079cd8c90c53be8;network/wifi;model/iPhone10,2;appBuild/100351;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/62;pap/JA2015_311210;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
|
||||
"Accept-Language": "zh-cn",
|
||||
Referer: "https://wqsd.jd.com/pingou/dream_factory/index.html",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return new Promise(resolve => {
|
||||
$.get(
|
||||
JXGC_taskurl(
|
||||
"userinfo/GetUserInfo",
|
||||
`pin=&sharePin=&shareType=&materialTuanPin=&materialTuanId=`
|
||||
),
|
||||
async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`);
|
||||
console.log(`京喜工厂 API请求失败,请检查网路重试`);
|
||||
} else {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
if (data["ret"] === 0) {
|
||||
data = data["data"];
|
||||
$.unActive = true; //标记是否开启了京喜活动或者选购了商品进行生产
|
||||
$.encryptPin = "";
|
||||
$.shelvesList = [];
|
||||
if (data.factoryList && data.productionList) {
|
||||
const production = data.productionList[0];
|
||||
const factory = data.factoryList[0];
|
||||
const productionStage = data.productionStage;
|
||||
$.factoryId = factory.factoryId; //工厂ID
|
||||
$.productionId = production.productionId; //商品ID
|
||||
$.commodityDimId = production.commodityDimId;
|
||||
$.encryptPin = data.user.encryptPin;
|
||||
// subTitle = data.user.pin;
|
||||
console.log(`【京东账号${$.index}(${$.UserName})京喜工厂】${data.user.encryptPin}`);
|
||||
}
|
||||
} else {
|
||||
$.unActive = false; //标记是否开启了京喜活动或者选购了商品进行生产
|
||||
if (!data.factoryList) {
|
||||
console.log(
|
||||
`【提示】京东账号${$.index}[${$.nickName}]京喜工厂活动未开始请手动去京东APP->游戏与互动->查看更多->京喜工厂 开启活动`
|
||||
);
|
||||
} else if (data.factoryList && !data.productionList) {
|
||||
console.log(
|
||||
`【提示】京东账号${$.index}[${$.nickName}]京喜工厂未选购商品请手动去京东APP->游戏与互动->查看更多->京喜工厂 选购`
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(`GetUserInfo异常:${JSON.stringify(data)}`);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp);
|
||||
} finally {
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
function getJdPet(){
|
||||
const JDPet_API_HOST = "https://api.m.jd.com/client.action";
|
||||
|
Loading…
Reference in New Issue
Block a user