不需助力的脚本,IOS上支持 京东多账号 Ck 管理,多账号cookie使用详情见 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/JD_extra_cookie.js

This commit is contained in:
lxk0301
2020-12-11 15:55:42 +08:00
parent f0d1f64d12
commit deeadb30b5
31 changed files with 449 additions and 33 deletions

View File

@ -32,8 +32,10 @@ if ($.isNode()) {
})
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
} else {
cookiesArr.push($.getdata('CookieJD'));
cookiesArr.push($.getdata('CookieJD2'));
let cookiesData = $.getdata('CookiesJD') || "[]";
cookiesData = jsonParse(cookiesData);
cookiesArr = cookiesData.map(item => item.cookie);
cookiesArr.push(...[$.getdata('CookieJD'), $.getdata('CookieJD2')]);
}
const JD_API_HOST = 'https://api.m.jd.com/client.action';
!(async () => {
@ -377,6 +379,17 @@ function TotalBean() {
})
})
}
function jsonParse(str) {
if (typeof str == "string") {
try {
return JSON.parse(str);
} catch (e) {
console.log(e);
$.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie')
return [];
}
}
}
function taskUrl(function_id, body = {}, appId = 'vip_h5') {
return {
url: `${JD_API_HOST}?functionId=${function_id}&appid=${appId}&body=${escape(JSON.stringify(body))}&_=${Date.now()}`,