update
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
/*
|
||||
京豆签到,自用,可N个京东账号,IOS软件用户请使用 https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
|
||||
Node.JS专用
|
||||
更新时间:2021-1-7
|
||||
更新时间:2021-1-19
|
||||
从 github @ruicky改写而来
|
||||
version v0.0.1
|
||||
create by ruicky
|
||||
@ -201,7 +201,20 @@ function TotalBean() {
|
||||
}
|
||||
function downloadUrl(url = 'https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js') {
|
||||
return new Promise(resolve => {
|
||||
$.get({url}, async (err, resp, data) => {
|
||||
const options = { url };
|
||||
if (process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) {
|
||||
const tunnel = require("tunnel");
|
||||
const agent = {
|
||||
https: tunnel.httpsOverHttp({
|
||||
proxy: {
|
||||
host: process.env.TG_PROXY_HOST,
|
||||
port: process.env.TG_PROXY_PORT * 1
|
||||
}
|
||||
})
|
||||
}
|
||||
Object.assign(options, { agent })
|
||||
}
|
||||
$.get(options, async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
|
Reference in New Issue
Block a user