From 5c4d5773d8ec47280881d18ccaf12ea35db02826 Mon Sep 17 00:00:00 2001 From: youfak Date: Sun, 5 Jan 2025 23:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0cookie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jdCookie.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 jdCookie.js diff --git a/jdCookie.js b/jdCookie.js new file mode 100644 index 0000000..05783bc --- /dev/null +++ b/jdCookie.js @@ -0,0 +1,26 @@ +/* +此文件为Node.js专用。其他用户请忽略 + */ +//此处填写京东账号cookie。 +let CookieJDs = [ + ] +// 判断环境变量里面是否有京东ck +if (process.env.JD_COOKIE) { + if (process.env.JD_COOKIE.indexOf('&') > -1) { + CookieJDs = process.env.JD_COOKIE.split('&'); + } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { + CookieJDs = process.env.JD_COOKIE.split('\n'); + } else { + CookieJDs = [process.env.JD_COOKIE]; + } +} +CookieJDs = [...new Set(CookieJDs.filter(item => !!item))] +console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=========\n`); +console.log(`==================脚本执行- 北京时间(UTC+8):${new Date( + new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 + * 60 * 1000).toLocaleString()}=====================\n`) + +for (let i = 0; i < CookieJDs.length; i++) { + const index = (i + 1 === 1) ? '' : (i + 1); + exports['CookieJD' + index] = CookieJDs[i].trim(); +}