From 3849dce8a205a62ff43e19929b34d608047893d9 Mon Sep 17 00:00:00 2001 From: Akira Date: Tue, 22 Dec 2020 23:22:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E8=B0=83=E6=95=B46=E4=B8=AA=E5=A4=A7?= =?UTF-8?q?=E5=AE=B6=E5=8F=AF=E4=BB=A5=E4=BA=92=E5=8A=A9=E7=9A=84=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=BA=92=E5=8A=A9=E7=A0=81=E8=BE=93=E5=87=BA=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=202.=E5=A2=9E=E5=8A=A0=E6=8F=90=E5=8F=96=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E4=B8=AD=E5=90=84=E4=B8=AA=E8=B4=A6=E5=8F=B7=E4=BA=92?= =?UTF-8?q?=E5=8A=A9=E7=A0=81=E8=84=9A=E6=9C=AC=E4=BA=92=E5=8A=A9=E7=A0=81?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=95=B4=E7=90=86=E5=88=B0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/default_task.sh | 2 ++ docker/proc_file.sh | 36 ++++++++++++++++++++++++++++++++++++ jd_dreamFactory.js | 2 +- jd_fruit.js | 2 +- jd_jdfactory.js | 2 +- jd_jdzz.js | 2 +- jd_pet.js | 2 +- jd_plantBean.js | 2 +- 8 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 docker/proc_file.sh diff --git a/docker/default_task.sh b/docker/default_task.sh index f47d8fdf..d099871c 100644 --- a/docker/default_task.sh +++ b/docker/default_task.sh @@ -114,3 +114,5 @@ fi echo "加载最新的定时任务文件..." crontab $mergedListFile + +sh -x /scripts/docker/proc_file.sh \ No newline at end of file diff --git a/docker/proc_file.sh b/docker/proc_file.sh new file mode 100644 index 00000000..4674a923 --- /dev/null +++ b/docker/proc_file.sh @@ -0,0 +1,36 @@ +#!/bin/sh +set -e + +echo "整理各个日志文件里面的互助码相关信息。。。" +echo "===========================================================================" +logdDir="/scripts/logs" +sharecodeFile="${logdDir}/sharecode.log" +jdzzFile="${logdDir}/jd_jdzz.log" +jdfactoryFile="${logdDir}/jd_jdfactory.log" +jxFactoryFile="${logdDir}/jd_dreamFactory.log" +plantBean="${logdDir}/jd_plantBean.log" +jdfruit="${logdDir}/jd_fruit.log" +jdpet="${logdDir}/jd_pet.log" + +echo -e >>$sharecodeFile + +sed -n '/京东赚赚好友互助码】.*/'p $jdzzFile | awk '{print $1}' | sort | uniq >>$sharecodeFile +echo "提取京东赚赚助力码完成" + +sed -n '/东东工厂好友互助码】.*/'p $jdfactoryFile | awk '{print $1}' | sort | uniq >>$sharecodeFile +echo "提取东东工厂助力码完成" + +sed -n '/京喜工厂好友互助码.*/'p $jxFactoryFile | awk '{print $1}' | sort | uniq >>$sharecodeFile +echo "提取京喜工厂助力码完成" + +sed -n '/京东种豆得豆好友互助码】.*/'p $plantBean | awk '{print $1}' | sort | uniq >>$sharecodeFile +echo "提取京东种豆助力码完成" + +sed -n '/东东农场好友互助码】.*/'p $jdfruit | awk '{print $1}' | sort | uniq >>$sharecodeFile +echo "提取京东农场助力码完成" + +sed -n '/东东萌宠好友互助码】.*/'p $jdpet | awk '{print $1}' | sort | uniq >>$sharecodeFile +echo "提取东东萌宠助力码完成" + +echo "===========================================================================" +echo "整理完成,具体结果请查看${sharecodeFile}文件" diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index eb08898f..dbdd5012 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -547,7 +547,7 @@ function userInfo() { } console.log(`当前电力:${data.user.electric}`) console.log(`当前等级:${data.user.currentLevel}`) - console.log(`分享码: ${data.user.encryptPin}`); + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${data.user.encryptPin}`); console.log(`已投入电力:${production.investedElectric}`); console.log(`所需电力:${production.needElectric}`); console.log(`生产进度:${((production.investedElectric / production.needElectric) * 100).toFixed(2)}%`); diff --git a/jd_fruit.js b/jd_fruit.js index 716e133d..c996e7b8 100644 --- a/jd_fruit.js +++ b/jd_fruit.js @@ -85,7 +85,7 @@ async function jdFruit() { // option['media-url'] = $.farmInfo.farmUserPro.goodsImage; subTitle = `【京东账号${$.index}】${$.nickName}`; message = `【水果名称】${$.farmInfo.farmUserPro.name}\n`; - console.log(`\n【您的${$.name}互助码shareCode】 ${$.farmInfo.farmUserPro.shareCode}\n`); + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${$.farmInfo.farmUserPro.shareCode}\n`); console.log(`\n【已成功兑换水果】${$.farmInfo.farmUserPro.winTimes}次\n`); message += `【已兑换水果】${$.farmInfo.farmUserPro.winTimes}次\n`; await masterHelpShare();//助力好友 diff --git a/jd_jdfactory.js b/jd_jdfactory.js index 1ec93e60..0c404e82 100644 --- a/jd_jdfactory.js +++ b/jd_jdfactory.js @@ -446,7 +446,7 @@ function jdfactory_getTaskDetail() { $.taskVos = data.data.result.taskVos;//任务列表 $.taskVos.map(item => { if (item.taskType === 14) { - console.log(`\n您的${$.name}好友助力邀请码:${item.assistTaskDetailVo.taskToken}\n`) + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${item.assistTaskDetailVo.taskToken}\n`) } }) } diff --git a/jd_jdzz.js b/jd_jdzz.js index a7462105..74c2f4a9 100644 --- a/jd_jdzz.js +++ b/jd_jdzz.js @@ -255,7 +255,7 @@ function getUserInfo() { if (safeGet(data)) { data = JSON.parse(data); if (data.data.shareTaskRes) { - console.log(`\n您的${$.name}好友助力码为: ${data.data.shareTaskRes.itemId}\n`); + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${data.data.shareTaskRes.itemId}\n`); } else { console.log(`已满5人助力,暂时看不到您的${$.name}好友助力码`) } diff --git a/jd_pet.js b/jd_pet.js index c0b342fb..3671f3b7 100644 --- a/jd_pet.js +++ b/jd_pet.js @@ -115,7 +115,7 @@ async function jdPet() { } return } - console.log(`\n【您的${$.name}互助码shareCode】 ${$.petInfo.shareCode}\n`); + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${$.petInfo.shareCode}\n`); await taskInit(); if ($.taskInit.resultCode === '9999' || !$.taskInit.result) { console.log('初始化任务异常, 请稍后再试'); diff --git a/jd_plantBean.js b/jd_plantBean.js index b7393db3..4ae0779b 100644 --- a/jd_plantBean.js +++ b/jd_plantBean.js @@ -89,7 +89,7 @@ async function jdPlantBean() { if ($.plantBeanIndexResult.code === '0') { const shareUrl = $.plantBeanIndexResult.data.jwordShareInfo.shareUrl $.myPlantUuid = getParam(shareUrl, 'plantUuid') - console.log(`\n【您的${$.name}互助码】 ${$.myPlantUuid}\n`); + console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${$.myPlantUuid}\n`); roundList = $.plantBeanIndexResult.data.roundList; currentRoundId = roundList[1].roundId;//本期的roundId lastRoundId = roundList[0].roundId;//上期的roundId From cf063062a89122e2c9a06571f7bd7e40e813c1f4 Mon Sep 17 00:00:00 2001 From: Akira Date: Tue, 22 Dec 2020 23:28:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=89=8D=E6=B8=85=E7=A9=BA=E4=BA=92=E5=8A=A9?= =?UTF-8?q?=E7=A0=81=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/proc_file.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/proc_file.sh b/docker/proc_file.sh index 4674a923..6ad3a51a 100644 --- a/docker/proc_file.sh +++ b/docker/proc_file.sh @@ -12,7 +12,7 @@ plantBean="${logdDir}/jd_plantBean.log" jdfruit="${logdDir}/jd_fruit.log" jdpet="${logdDir}/jd_pet.log" -echo -e >>$sharecodeFile +echo -e >$sharecodeFile sed -n '/京东赚赚好友互助码】.*/'p $jdzzFile | awk '{print $1}' | sort | uniq >>$sharecodeFile echo "提取京东赚赚助力码完成"