diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 00a9d7ec..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -name: Bug 反馈 -about: 运行js脚本时出现bug -title: '' -labels: '' -assignees: '' - ---- - - - - - - - - - - - - -## 1.关于你要提交的问题 - -Q:是否搜索了issue(包括已关闭的issue) -- [ ] 没有类似的issue - -Q:是否仔细阅读了教程 -- [ ] 已仔细阅读教程 - -## 2. 你使用的哪种部署方法 - - - - - - -- [ ] 方法一:本地安装Node.js -- [ ] 方法二:腾讯云函数 -- [ ] 方法三:Docker办法一 -- [ ] 方法三:Docker办法二 -- [ ] 方法三:Docker办法三 -- [ ] 方法四:iOS系统的代理软件 - - -## 3. 详细叙述 -### (1) 具体问题 -A: - -### (2) 详细日志 -A: - - - - - -## 4.软件版本和 npm install 结果 -### (1) Node.js版本 - -A: - -### (2) npm版本 - -A: - -### (3)npm install的日志 - -A: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index d741913c..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -name: 功能建议 -about: 请求实现新功能或改进已有功能 -title: '' -labels: '' -assignees: '' - ---- - - - - - - - - - - - - -## 期望增加的功能 - -A: - - - - - -## 入口 - -A: diff --git a/docker/Readme.md b/docker/Readme.md index cd1a3f33..26cb2033 100644 --- a/docker/Readme.md +++ b/docker/Readme.md @@ -9,7 +9,7 @@ sudo chmod +x /usr/local/bin/docker-compose ### 如果需要使用 docker 多个账户独立并发执行定时任务,[参考这里](https://github.com/iouAkira/scripts/blob/patch-1/docker/docker%E5%A4%9A%E8%B4%A6%E6%88%B7%E4%BD%BF%E7%94%A8%E7%8B%AC%E7%AB%8B%E5%AE%B9%E5%99%A8%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md#%E4%BD%BF%E7%94%A8%E6%AD%A4%E6%96%B9%E5%BC%8F%E8%AF%B7%E5%85%88%E7%90%86%E8%A7%A3%E5%AD%A6%E4%BC%9A%E4%BD%BF%E7%94%A8docker%E5%8A%9E%E6%B3%95%E4%B8%80%E7%9A%84%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F) ⚠️⚠️⚠️2020-12-11更新镜像启动方式,虽然兼容旧版的运行启动方式,但是强烈建议更新镜像和配置后使用 -- 更新后`commad:`指令配置不再需要 +- 更新后`command:`指令配置不再需要 - 更新后可以使用自定义任务文件追加在默任务文件之后,比以前的完全覆盖多一个选择 - - 新的自定两个环境变量为 `CUSTOM_LIST_MERGE_TYPE`:自定文件的生效方式可选值为`append`,`overwrite`默认为`append` ; `CUSTOM_LIST_FILE`: 自定义文件的名字 - 更新镜像增减镜像更新通知,以后镜像如果更新之后,会通知用户更新 diff --git a/jdJxStoryShareCodes.js b/jdJxStoryShareCodes.js deleted file mode 100644 index 94534295..00000000 --- a/jdJxStoryShareCodes.js +++ /dev/null @@ -1,30 +0,0 @@ -/* -京喜故事互助码 -此文件为Node.js专用。其他用户请忽略 -支持京东N个账号 - */ -//云服务器腾讯云函数等Node.js用户在此处填写京喜故事的好友码。 -// github action用户的好友互助码填写到Action->Settings->Secrets->new Secret里面(Name填写 JXSTORY_SHARECODES(此处的Name必须按此来写,不能随意更改),内容处填写互助码,填写规则如下) -// 同一个京东账号的好友互助码用@符号隔开,不同京东账号之间用&符号或者换行隔开,下面给一个示例 -// 如: 京东账号1的shareCode1@京东账号1的shareCode2&京东账号2的shareCode1@京东账号2的shareCode2 -let shareCodes = [ - '',//账号一的好友shareCode,不同好友中间用@符号隔开 - '',//账号二的好友shareCode -] -// 判断github action里面是否有京喜故事互助码 -if (process.env.JXSTORY_SHARECODES) {if (process.env.JXSTORY_SHARECODES.indexOf('&') > -1) { - console.log(`您的互助码选择的是用&隔开\n`) - shareCodes = process.env.JXSTORY_SHARECODES.split('&'); - } else if (process.env.JXSTORY_SHARECODES.indexOf('\n') > -1) { - console.log(`您的互助码选择的是用换行隔开\n`) - shareCodes = process.env.JXSTORY_SHARECODES.split('\n'); - } else { - shareCodes = process.env.JXSTORY_SHARECODES.split(); - } -} else if (process.env.JXSTORY_SHARECODES) { - console.log(`由于您secret里面未提供助力码,故此处运行将会给脚本内置的码进行助力,请知晓!`) -} -for (let i = 0; i < shareCodes.length; i++) { - const index = (i + 1 === 1) ? '' : (i + 1); - exports['shareCodes' + index] = shareCodes[i]; -} diff --git a/jd_bean_home.js b/jd_bean_home.js index b97f1772..136287d7 100644 --- a/jd_bean_home.js +++ b/jd_bean_home.js @@ -46,7 +46,8 @@ if ($.isNode()) { const JD_API_HOST = 'https://api.m.jd.com/'; !(async () => { $.newShareCodes = [] - await getAuthorShareCode() + await getAuthorShareCode(); + await getAuthorShareCode2(); if (!cookiesArr[0]) { $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); return; @@ -74,21 +75,34 @@ const JD_API_HOST = 'https://api.m.jd.com/'; await jdBeanHome(); } } - for (let i = 0; i < cookiesArr.length; i++) { - if (cookiesArr[i]) { - $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) - console.log(`${$.UserName}去帮助下一个人`) - cookie = cookiesArr[i]; - if ($.newShareCodes.length > 1) { - let code = $.newShareCodes[(i + 1) % $.newShareCodes.length] - await help(code[0], code[1]) + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + console.log(`${$.UserName}去帮助下一个人`) + cookie = cookiesArr[i]; + if ($.newShareCodes.length > 1) { + let code = $.newShareCodes[(i + 1) % $.newShareCodes.length] + await help(code[0], code[1]) + } + if (helpAuthor && $.authorCode) { + console.log(`去帮助作者`) + const helpRes = await help($.authorCode[0], $.authorCode[1]) + if (helpRes && helpRes.data.respCode === 'SG209') { + console.log(`助力次数已耗尽,跳出助力`) + break; } - if (helpAuthor && $.authorCode) { - console.log(`去帮助作者`) - await help($.authorCode[0], $.authorCode[1]) + } + if (helpAuthor && $.authorCode2) { + for (let code of $.authorCode2) { + const helpRes = await help(code.shareCode, code.groupCode); + if (helpRes && helpRes.data.respCode === 'SG209') { + console.log(`助力次数已耗尽,跳出助力`) + break; + } } } } + } })() .catch((e) => { $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') @@ -121,7 +135,26 @@ function getAuthorShareCode() { }) }) } - +function getAuthorShareCode2() { + return new Promise(resolve => { + $.get({url: "https://gitee.com/lxk0301/updateTeam/raw/master/jd_updateBeanHome.json",headers:{ + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + }}, async (err, resp, data) => { + try { + if (err) { + } else { + if (safeGet(data)) { + $.authorCode2 = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} function getUserInfo() { return new Promise(resolve => { $.post(taskUrl('signBeanGroupStageIndex', 'body'), async (err, resp, data) => { @@ -219,7 +252,7 @@ function help(shareCode, groupCode, isTask = 0) { } catch (e) { $.logErr(e, resp) } finally { - resolve(); + resolve(data); } }) }) diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index 7d2e5328..39d8fe62 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -1014,7 +1014,7 @@ function CreateTuan() { } async function joinLeaderTuan() { await updateTuanIds(); - if (!$.tuanIdS) await updateTuanIdsCDN(); + if (!$.tuanIdS) await updateTuanIdsCDN('https://gitee.com/lxk0301/updateTeam/raw/master/jd_updateFactoryTuanId.json'); if (!$.tuanIdS) await updateTuanIdsCDN('https://cdn.jsdelivr.net/gh/lxk0301/updateTeam@master/jd_updateFactoryTuanId.json'); for (let tuanId of $.tuanIdS.tuanIds) { if (!tuanId) continue @@ -1204,7 +1204,9 @@ function updateTuanIdsCDN(url = 'https://raw.fastgit.org/lxk0301/updateTeam/mast if (err) { console.log(`${JSON.stringify(err)}`) } else { - $.tuanIdS = JSON.parse(data); + if (safeGet(data)) { + $.tuanIdS = JSON.parse(data); + } } } catch (e) { $.logErr(e, resp) diff --git a/jd_necklace.js b/jd_necklace.js index 0f8a67bd..c16cce31 100644 --- a/jd_necklace.js +++ b/jd_necklace.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://github.com/lxk0301 * @Date: 2020-11-20 11:42:03 * @Last Modified by: lxk0301 - * @Last Modified time: 2020-11-23 12:27:14 + * @Last Modified time: 2020-12-12 12:27:14 */ /* 点点券,可以兑换无门槛红包(1元,5元,10元,100元,部分红包需抢购) @@ -30,7 +30,8 @@ const $ = new Env('点点券'); const notify = $.isNode() ? require('./sendNotify') : ''; //Node.js用户请在jdCookie.js处填写京东ck; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; - +const openUrl = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/41Lkp7DumXYCFmPYtU3LTcnTTXTX/index.html%22%20%7D` +let message = ''; //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = ''; if ($.isNode()) { @@ -60,6 +61,7 @@ const JD_API_HOST = 'https://api.m.jd.com/api'; $.index = i + 1; $.isLogin = true; $.nickName = ''; + message = ''; await TotalBean(); console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`); if (!$.isLogin) { @@ -89,11 +91,14 @@ async function jd_necklace() { await receiveBubbles(); await sign(); await necklace_homePage(); + // await necklace_exchangeGift(10);//自动兑换多少钱的无门槛红包,1000代表1元 await showMsg(); } function showMsg() { - return new Promise(resolve => { - $.msg($.name, '', `京东账号 ${$.index} ${$.nickName}\n当前${$.name}${$.totalScore}个`); + return new Promise(async resolve => { + $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n当前${$.name}:${$.totalScore}个\n可兑换无门槛红包:${$.totalScore / 1000}元\n点击弹窗即可去兑换(注:此红包具有时效性)`, { 'open-url': openUrl}); + // 云端大于10元无门槛红包时进行通知推送 + if ($.isNode() && $.totalScore >= 10000) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `京东账号${$.index} ${$.nickName}\n当前${$.name}:${$.totalScore}个\n可兑换无门槛红包:${$.totalScore / 1000}元\n点击链接即可去兑换(注:此红包具有时效性)\n↓↓↓ \n\n ${openUrl} \n\n ↑↑↑`, { url: openUrl }) resolve() }) } @@ -108,6 +113,8 @@ async function doTask() { console.log(`${item.taskName}任务已做完,奖励未领取`); } else if (item.taskStage === 3) { console.log(`${item.taskName}奖励已领取`); + } else if (item.taskStage === 1) { + console.log(`${item.taskName}任务未完成\n`); } } } @@ -136,7 +143,6 @@ function necklace_sign() { console.log(`${JSON.stringify(err)}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { - console.log(data); if (safeGet(data)) { data = JSON.parse(data); if (data.rtn_code === 0) { @@ -156,6 +162,40 @@ function necklace_sign() { }) }) } +//兑换无门槛红包 +function necklace_exchangeGift(scoreNums) { + return new Promise(resolve => { + const body = { + scoreNums, + "giftConfigId": 31, + currentDate: $.lastRequestTime.replace(/:/g, "%3A"), + } + $.post(taskPostUrl("necklace_exchangeGift", body), async (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.rtn_code === 0) { + if (data.data.biz_code === 0) { + const { result } = data.data; + message += `${result.redpacketTitle}:${result.redpacketAmount}元兑换成功\n`; + message += `红包有效期:${new Date(result.endTime + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString('zh', {hour12: false})}`; + console.log(message) + } + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} //领取奖励 function necklace_chargeScores(bubleId) { return new Promise(resolve => { @@ -169,7 +209,6 @@ function necklace_chargeScores(bubleId) { console.log(`${JSON.stringify(err)}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { - console.log(data); if (safeGet(data)) { data = JSON.parse(data); if (data.rtn_code === 0) { @@ -200,7 +239,6 @@ function necklace_startTask(taskId) { console.log(`${JSON.stringify(err)}`) console.log(`${$.name} API请求失败,请检查网路重试`) } else { - console.log(data); if (safeGet(data)) { data = JSON.parse(data); if (data.rtn_code === 0) { diff --git a/jd_small_home.js b/jd_small_home.js index 47d58a67..1358ea10 100644 --- a/jd_small_home.js +++ b/jd_small_home.js @@ -136,7 +136,7 @@ async function doChannelsListTask(taskId, taskType) { async function helpFriends() { await updateInviteCode(); if (!$.inviteCodes) await updateInviteCodeCDN(); - if (!$.inviteCodes) await updateInviteCodeCDN('https://cdn.jsdelivr.net/gh/lxk0301/updateTeam@master/jd_updateSmallHomeInviteCode.json'); + if (!$.inviteCodes) await updateInviteCodeCDN('https://gitee.com/lxk0301/updateTeam/raw/master/jd_updateSmallHomeInviteCode.json'); for (let item of $.inviteCodes.inviteCode) { if (!item) continue await createAssistUser(item, $.createAssistUserID || "1318106976846299138"); diff --git a/serverless.yml b/serverless.yml index e4213ab2..e0bebd53 100644 --- a/serverless.yml +++ b/serverless.yml @@ -70,12 +70,12 @@ inputs: cronExpression: "0 0 10 * * * *" enable: true argument: jd_bean_change&jd_rankingList&jd_bean_home&jd_car - - timer: # 金融养猪#十元街# 京东快递 + - timer: # 金融养猪#十元街# 京东快递# 金融打卡领年终奖 parameters: - name: pigPet_syj_kd - cronExpression: "0 3 2 * * * *" + name: pigPet_syj_kd_jr_sign + cronExpression: "0 3 1 * * * *" enable: true - argument: jd_pigPet&jd_syj&jd_kd + argument: jd_pigPet&jd_syj&jd_kd&jr_sign environment: # 环境变量 variables: # 环境变量对象 AAA: BBB # 不要删除,用来格式化对齐追加的变量的