代码拉取完成,页面将自动刷新
import axios from "axios";
import {readFileSync, writeFileSync, unlinkSync} from "fs";
import {execSync} from "child_process";
import {requireConfig} from "./TS_USER_AGENTS";
import {sendNotify} from './sendNotify';
let message: string = '';
async function main() {
let cookiesArr: string[] = await requireConfig();
let cookiesNobyDa: {
cookie: string
}[] = []
for (let i = 0; i < cookiesArr.length; i++) {
cookiesNobyDa.push({cookie: cookiesArr[i]})
}
let data: any = '';
try {
data = await axios.get('https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', {timeout: 5000})
data = data.data
console.log('raw')
} catch (e) {
console.log('非脚本问题!网络错误,访问github失败')
}
if (data.indexOf('京东多合一签到脚本') > -1) {
data = data.replace('var OtherKey = ``;', `var OtherKey = \`${JSON.stringify(cookiesNobyDa)}\`;`)
data = data.replace(/ztmFUCxcPMNyUq0P/g, 'q8DNJdpcfRQ69gIx')
writeFileSync('./sign.js', data, 'utf-8')
execSync('node ./sign.js >> ./sign.log')
data = readFileSync('./sign.log', 'utf-8')
data = data.match(/【.*/gm)
message += data.join('\n').replace(/红包/g, '红包\n\n')
unlinkSync('./sign.js')
unlinkSync('./sign.log')
}
await sendNotify('京东多合一签到脚本 via NobyDa@Github', message)
}
main().then()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。