mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-19 21:28:03 +08:00
Update jd_share.js
This commit is contained in:
parent
27b00bf8ec
commit
543c7236b3
36
jd_share.js
Normal file → Executable file
36
jd_share.js
Normal file → Executable file
@ -1,25 +1,14 @@
|
||||
/*
|
||||
甘露殿-https://t.me/jdredrain
|
||||
|
||||
自动车监控脚本-分享有礼
|
||||
https://raw.githubusercontent.com/msechen/jdrain/main/jd_share.js
|
||||
|
||||
环境变量
|
||||
ownCookieNum 需要助力数量,默认4个
|
||||
SHARE_ACTIVITY_ID活动id
|
||||
|
||||
作者:小埋h ttps://t.me/okyydsnb
|
||||
关注 https://t.me/okyydsnb
|
||||
7 7 7 7 7
|
||||
注意控制ck数量
|
||||
|
||||
即时任务,无需cron
|
||||
*/
|
||||
const $ = new Env("自动车-分享有礼");
|
||||
const $ = new Env("分享有礼");
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
let cookiesArr = [], cookie = '', message = '';
|
||||
let authorCodeList = [];
|
||||
let ownCookieNum = 4;
|
||||
let ownCookieNum = 1;
|
||||
let isGetAuthorCodeList = true
|
||||
let activityId = ''
|
||||
let activityShopId = ''
|
||||
@ -45,6 +34,7 @@ if ($.isNode()) {
|
||||
cookiesArr.reverse();
|
||||
cookiesArr = cookiesArr.filter(item => !!item);
|
||||
}
|
||||
console.log("关注 https://t.me/okyydsnb")
|
||||
!(async () => {
|
||||
if (!cookiesArr[0]) {
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
|
||||
@ -92,13 +82,14 @@ if ($.isNode()) {
|
||||
$.index = i + 1;
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
$.errorMessage = ''
|
||||
await checkCookie();
|
||||
console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
||||
if (!$.isLogin) {
|
||||
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
|
||||
if ($.isNode()) {
|
||||
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
|
||||
}
|
||||
// if ($.isNode()) {
|
||||
// await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
|
||||
// }
|
||||
continue
|
||||
}
|
||||
|
||||
@ -114,9 +105,15 @@ if ($.isNode()) {
|
||||
for(let i in authorCodeList){
|
||||
$.authorCode = authorCodeList[i]
|
||||
console.log('去助力: '+$.authorCode)
|
||||
|
||||
await share();
|
||||
if ($.errorMessage === '活动太火爆,还是去买买买吧') {
|
||||
break
|
||||
}
|
||||
await $.wait(2000)
|
||||
}
|
||||
}
|
||||
await $.wait(2000)
|
||||
}
|
||||
for (let i = 0; i < ownCookieNum; i++) {
|
||||
if (cookiesArr[i]) {
|
||||
@ -131,6 +128,7 @@ if ($.isNode()) {
|
||||
$.activityId = activityId
|
||||
$.activityShopId = activityShopId
|
||||
await getPrize();
|
||||
await $.wait(2000)
|
||||
}
|
||||
}
|
||||
})()
|
||||
@ -151,6 +149,7 @@ async function share () {
|
||||
if ($.token) {
|
||||
await getMyPing();
|
||||
if ($.secretPin) {
|
||||
await $.wait(2000)
|
||||
await task('common/accessLogWithAD', `venderId=${$.activityShopId}&code=25&pin=${encodeURIComponent($.secretPin)}&activityId=${$.activityId}&pageUrl=${$.activityUrl}&subType=app&adSource=null`, 1);
|
||||
await task('activityContent', `activityId=${$.activityId}&pin=${encodeURIComponent($.secretPin)}&friendUuid=${encodeURIComponent($.authorCode)}`)
|
||||
} else {
|
||||
@ -303,7 +302,8 @@ function getMyPing () {
|
||||
$.secretPin = data.data.secretPin;
|
||||
cookie = `${cookie};AUTH_C_USER=${data.data.secretPin}`
|
||||
} else {
|
||||
$.log(data.errorMessage)
|
||||
$.errorMessage = data.errorMessage
|
||||
$.log($.errorMessage)
|
||||
}
|
||||
} else {
|
||||
$.log("京东返回了空数据")
|
||||
|
Loading…
Reference in New Issue
Block a user