mirror of https://github.com/KingRan/KR.git
main
parent
b6bfa5ed10
commit
618be6eaa5
|
@ -243,11 +243,15 @@ function jdApi(functionId,body) {
|
||||||
console.log(`${$.toStr(err)}`)
|
console.log(`${$.toStr(err)}`)
|
||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||||
} else {
|
} else {
|
||||||
|
// console.log(data)
|
||||||
let res = $.toObj(data, data);
|
let res = $.toObj(data, data);
|
||||||
if (typeof res == 'object') {
|
if (typeof res == 'object') {
|
||||||
if (res.mainTitle) console.log(res.mainTitle)
|
if (res.mainTitle) console.log(res.mainTitle)
|
||||||
if (res.resultCode == 0) {
|
if (res.resultCode == 0) {
|
||||||
resolve(res);
|
resolve(res);
|
||||||
|
} else if (res.tips && res.tips.includes("正在努力加载")) {
|
||||||
|
console.log("请求太快,ip被限制了")
|
||||||
|
$.out = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -320,8 +324,8 @@ function jdSign(fn, body) {
|
||||||
|
|
||||||
function taskPostUrl(url, body) {
|
function taskPostUrl(url, body) {
|
||||||
return {
|
return {
|
||||||
url: `https://api.m.jd.com${url}`,
|
url: `https://api.m.jd.com${url}&${body}`,
|
||||||
body: body,
|
//body: body,
|
||||||
headers: {
|
headers: {
|
||||||
"Accept": "*/*",
|
"Accept": "*/*",
|
||||||
"Accept-Language": "zh-cn",
|
"Accept-Language": "zh-cn",
|
||||||
|
|
Loading…
Reference in New Issue