API 请求超时由 3000 改为 10000

This commit is contained in:
guyuexuan
2021-01-13 15:50:26 +08:00
parent 0715d79954
commit faa28664d9
4 changed files with 15 additions and 15 deletions

View File

@ -1168,7 +1168,7 @@ async function initForFarm() {
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"),
"Content-Type": "application/x-www-form-urlencoded"
},
timeout: 3000,
timeout: 10000,
};
$.post(option, (err, resp, data) => {
try {
@ -1240,7 +1240,7 @@ function timeFormat(time) {
}
function readShareCode() {
return new Promise(async resolve => {
$.get({url: `http://api.turinglabs.net/api/v1/jd/farm/read/${randomCount}/`, timeout: 3000,}, (err, resp, data) => {
$.get({url: `http://api.turinglabs.net/api/v1/jd/farm/read/${randomCount}/`, timeout: 10000,}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
@ -1357,7 +1357,7 @@ function TotalBean() {
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0")
},
"timeout": 3000,
"timeout": 10000,
}
$.post(options, (err, resp, data) => {
try {
@ -1426,7 +1426,7 @@ function taskUrl(function_id, body = {}) {
Cookie: cookie,
UserAgent: $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"),
},
timeout: 3000,
timeout: 10000,
}
}
// prettier-ignore