update
This commit is contained in:
@@ -84,6 +84,7 @@ if ($.isNode()) {
|
|||||||
|
|
||||||
async function jdDreamFactory() {
|
async function jdDreamFactory() {
|
||||||
await userInfo();
|
await userInfo();
|
||||||
|
await JoinTuan();
|
||||||
await helpFriends();
|
await helpFriends();
|
||||||
if (!$.unActive) return
|
if (!$.unActive) return
|
||||||
await getUserElectricity();
|
await getUserElectricity();
|
||||||
@@ -584,7 +585,57 @@ function getFactoryIdByPin(pin) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//开团API
|
||||||
|
function CreateTuan() {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
$.get(taskurl('tuan/CreateTuan', `activeId=${escape('ilOin38J30PcT9xnWbx9lw==')}&isOpenApp=1&_time=${Date.now()}&_=${Date.now()}`), (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${JSON.stringify(err)}`)
|
||||||
|
console.log(`${$.name} API请求失败,请检查网路重试`);
|
||||||
|
} else {
|
||||||
|
if (safeGet(data)) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if (data['ret'] === 0) {
|
||||||
|
console.log(`开团成功tuanId为\n${data.data['tuanId']}`);
|
||||||
|
} else {
|
||||||
|
console.log(`异常:${JSON.stringify(data)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp)
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function JoinTuan() {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
$.get(taskurl('tuan/JoinTuan', `activeId=${escape('ilOin38J30PcT9xnWbx9lw==')}&tuanId=${escape('QvqM7GtgQQJUO8jaz1CYBA==')}&isOpenApp=1&_time=${Date.now()}&_=${Date.now()}`), (err, resp, data) => {
|
||||||
|
try {
|
||||||
|
if (err) {
|
||||||
|
console.log(`${JSON.stringify(err)}`)
|
||||||
|
console.log(`${$.name} API请求失败,请检查网路重试`);
|
||||||
|
} else {
|
||||||
|
if (safeGet(data)) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if (data['ret'] === 0) {
|
||||||
|
console.log(`参团成功\n${data.data['tuanId']}`);
|
||||||
|
} else {
|
||||||
|
console.log(`参团成功异常:${JSON.stringify(data)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
$.logErr(e, resp)
|
||||||
|
} finally {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
async function showMsg() {
|
async function showMsg() {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
let ctrTemp;
|
let ctrTemp;
|
||||||
@@ -616,7 +667,7 @@ function readShareCode() {
|
|||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
} else {
|
||||||
if (data) {
|
if (data) {
|
||||||
console.log(`随机取个${randomCount}码放到您固定的互助码后面`)
|
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -729,7 +780,7 @@ function taskurl(functionId, body = '') {
|
|||||||
'Host': 'm.jingxi.com',
|
'Host': 'm.jingxi.com',
|
||||||
'Accept': '*/*',
|
'Accept': '*/*',
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"),
|
'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',
|
'Accept-Language': 'zh-cn',
|
||||||
'Referer': 'https://wqsd.jd.com/pingou/dream_factory/index.html',
|
'Referer': 'https://wqsd.jd.com/pingou/dream_factory/index.html',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
|
@@ -585,7 +585,7 @@ function readShareCode() {
|
|||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
} else {
|
||||||
if (data) {
|
if (data) {
|
||||||
console.log(`随机取个${randomCount}码放到您固定的互助码后面`)
|
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user