From 3d59a2fd5a7e6135390b4378689b5effb0c480e4 Mon Sep 17 00:00:00 2001 From: KingRan Date: Tue, 1 Mar 2022 17:43:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_opencardL90.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/jd_opencardL90.js b/jd_opencardL90.js index 3cb5b6a..015b801 100644 --- a/jd_opencardL90.js +++ b/jd_opencardL90.js @@ -785,7 +785,29 @@ function getshopactivityId() { }) }) } - +function getAuthorCodeList(url) { + return new Promise(resolve => { + const options = { + url: `${url}?${new Date()}`, "timeout": 10000, headers: { + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + } + }; + $.get(options, async (err, resp, data) => { + try { + if (err) { + $.log(err) + } else { + if (data) data = JSON.parse(data) + } + } catch (e) { + $.logErr(e, resp) + data = null; + } finally { + resolve(data); + } + }) + }) +} function jsonParse(str) { if (typeof str == "string") { try {