-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfd.js
24 lines (24 loc) · 1.06 KB
/
cfd.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function GetCookie() {
const req = $request;
if (req.method != 'OPTIONS' && req.headers) {
const CV = (req.headers['Cookie'] || req.headers['cookie'] || '');
const ckItems = CV.match(/(pt_key|pt_pin)=.+?;/g);
if (/^https:\/\/(me-|)api(\.m|)\.jd\.com\/(client\.|user_new)/.test(req.url)) {
if (ckItems && ckItems.length == 2) {
const value = ckItems.join('');
$notification.post(value);
} else {
throw new Error("写入Cookie失败, 关键值缺失\n可能原因: 非网页获取 ‼️");
}
} else if (/^https:\/\/ms\.jr\.jd\.com\/gw\/generic\/hy\/h5\/m\/appSign\?/.test(req.url) && req.body) {
const value = CookieUpdate(CV, req.body, 'jrBody');
$notification.post(value);
} else if (req.url === 'http://www.apple.com/') {
throw new Error("类型错误, 手动运行请选择上下文环境为Cron ⚠️");
}
} else if (!req.headers) {
throw new Error("写入Cookie失败, 请检查匹配URL或配置内脚本类型 ⚠️");
}
}
GetCookie();
$notification.post("脚本执行完毕");