KingRan 2022-02-24 00:08:21 +08:00
parent f09f823067
commit 06c94dd133
2 changed files with 16 additions and 7 deletions

View File

@ -709,14 +709,14 @@ async function showMsg() {
ReturnMessage += `\n`;
if ($.beanCount){
ReturnMessage += `【当前京豆】${$.beanCount}豆(≈${(($.beanCount-$.beanChangeXi)/ 100).toFixed(2)}元)\n`;
strsummary+= `【当前京豆】${$.beanCount}豆(≈${(($.beanCount-$.beanChangeXi)/ 100).toFixed(2)}元)\n`;
ReturnMessage += `【当前京豆】${$.beanCount-$.beanChangeXi}豆(≈${(($.beanCount-$.beanChangeXi)/ 100).toFixed(2)}元)\n`;
strsummary+= `【当前京豆】${$.beanCount-$.beanChangeXi}豆(≈${(($.beanCount-$.beanChangeXi)/ 100).toFixed(2)}元)\n`;
} else {
if($.levelName || $.JingXiang)
ReturnMessage += `【当前京豆】获取失败,接口返回空数据\n`;
else{
ReturnMessage += `【当前京豆】${$.beanCount}豆(≈${(($.beanCount-$.beanChangeXi)/ 100).toFixed(2)}元)\n`;
strsummary += `【当前京豆】${$.beanCount}豆(≈${(($.beanCount-$.beanChangeXi)/ 100).toFixed(2)}元)\n`;
ReturnMessage += `【当前京豆】${$.beanCount-$.beanChangeXi}豆(≈${(($.beanCount-$.beanChangeXi)/ 100).toFixed(2)}元)\n`;
strsummary += `【当前京豆】${$.beanCount-$.beanChangeXi}豆(≈${(($.beanCount-$.beanChangeXi)/ 100).toFixed(2)}元)\n`;
}
}
@ -956,7 +956,7 @@ async function showMsg() {
if($.YunFeiQuan){
var strTempYF="【免运费券】"+$.YunFeiQuan+"张";
if($.YunFeiQuanEndTime)
strTempYF+=",有效期至"+$.YunFeiQuanEndTime;
strTempYF+="(有效期至"+$.YunFeiQuanEndTime+")";
strTempYF+="\n";
ReturnMessage +=strTempYF
strsummary +=strTempYF;
@ -964,7 +964,7 @@ async function showMsg() {
if($.YunFeiQuan2){
var strTempYF2="【免运费券】"+$.YunFeiQuan2+"张";
if($.YunFeiQuanEndTime2)
strTempYF+=",有效期至"+$.YunFeiQuanEndTime;
strTempYF+="(有效期至"+$.YunFeiQuanEndTime2+")";
strTempYF2+="\n";
ReturnMessage +=strTempYF2
strsummary +=strTempYF2;

View File

@ -27,12 +27,12 @@ cron "20 0-23/3 * * *" script-path=jd_joypark_joy.js,tag=汪汪乐园养joy
*/
const $ = new Env('汪汪乐园养joy');
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
const notify = $.isNode() ? require('./sendNotify') : '';
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [],
cookie = '';
let hotFlag = false;
let failed_cnt = 0
if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => {
cookiesArr.push(jdCookieNode[item])
@ -66,6 +66,8 @@ message = ""
// console.log(`\n汪汪乐园养joy 只运行 ${process.env.JOYPARK_JOY_START} 个Cookie\n`);
// break
// }
hotFlag = false
failed_cnt = 0
cookie = cookiesArr[i];
if (cookie) {
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
@ -355,6 +357,13 @@ function doJoyMerge(joyId1, joyId2) {
// if (data.code == '1006') {
// hotFlag = true
// }
if (data.code == '1006') {
failed_cnt += 1
}
if (failed_cnt == 5){
console.log('失败次数多,避免死循环,跳出!')
hot_flag = true
}
}
} catch (e) {
$.logErr(e, resp)