1 Star 1 Fork 863

小光/jdTools

forked from danwangshimoluo/jdTools 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
jdCookie.js 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
danwangshimoluo 提交于 2021-03-31 08:40 . fixed
/*
此文件为Node.js专用。其他用户请忽略
*/
//此处填写京东账号cookie。
let CookieJDs = [
]
// 判断环境变量里面是否有京东ck
if (process.env.JD_COOKIE) {
if (process.env.JD_COOKIE.indexOf('&') > -1) {
console.log(`您的cookie选择的是用&隔开\n`)
CookieJDs = process.env.JD_COOKIE.split('&');
} else if (process.env.JD_COOKIE.indexOf('\n') > -1) {
console.log(`您的cookie选择的是用换行隔开\n`)
CookieJDs = process.env.JD_COOKIE.split('\n');
} else {
CookieJDs = [process.env.JD_COOKIE];
}
}
if (JSON.stringify(process.env).indexOf('GITHUB')>-1) {
console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`);
!(async () => {
// await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`)
// await process.exit(0);
})()
}
CookieJDs = [...new Set(CookieJDs.filter(item => item !== "" && item !== null && item !== undefined))]
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();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/h1989101/jdTools.git
git@gitee.com:h1989101/jdTools.git
h1989101
jdTools
jdTools
JdScripts

搜索帮助

D67c1975 1850385 1daf7b77 1850385