mirror of https://github.com/KingRan/KR.git
parent
e4cb2f6a08
commit
3d59a2fd5a
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue