diff --git a/jd_cash_exchange.js b/jd_cash_exchange.js index 91d0e088..6c7df034 100644 --- a/jd_cash_exchange.js +++ b/jd_cash_exchange.js @@ -42,8 +42,15 @@ if ($.isNode()) { Object.keys(jdCookieNode).forEach((item) => { cookiesArr.push(jdCookieNode[item]) }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; } else { - cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); } !(async () => { await requireConfig(); diff --git a/jd_rankingList.js b/jd_rankingList.js index d3c4d2ae..74168b95 100644 --- a/jd_rankingList.js +++ b/jd_rankingList.js @@ -27,10 +27,15 @@ if ($.isNode()) { Object.keys(jdCookieNode).forEach((item) => { cookiesArr.push(jdCookieNode[item]) }) - if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { - }; + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; } else { - cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); } !(async () => {