-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathLKXDYF.js
More file actions
68 lines (60 loc) · 2.01 KB
/
Copy pathLKXDYF.js
File metadata and controls
68 lines (60 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//2025/07/26 22:55
/*
@Name:老百姓大药房小程序
@Author:怎么肥事
[rewrite_local]
^https:\/\/mall\.lbxcn\.com\/mall\/scc-point-member\/crm-api\/bonus\/sign-in url script-request-body https://raw.githubusercontent.com/ZenmoFeiShi/Qx/refs/heads/main/LKXDYF.js
[task_local]
1 0 * * * https://raw.githubusercontent.com/ZenmoFeiShi/Qx/refs/heads/main/LKXDYF.js, tag=老百姓大药房签到, enabled=true
[MITM]
hostname = mall.lbxcn.com
*/
const key = "lbx_signin_data";
const signUrl = "https://mall.lbxcn.com/mall/scc-point-member/crm-api/bonus/sign-in";
if ($request) {
const saved = {
url: $request.url,
method: $request.method,
headers: $request.headers,
body: $request.body || ""
};
$prefs.setValueForKey(JSON.stringify(saved), key);
$notify("老百姓大药房", "参数获取成功", "");
$done({});
} else {
const saved = $prefs.valueForKey(key);
if (!saved) {
$notify("老百姓大药房", "❌ 参数未获取", "请先手动打开App签到触发请求");
$done();
return;
}
const info = JSON.parse(saved);
const request = {
url: signUrl,
method: "POST",
headers: info.headers,
body: info.body
};
$task.fetch(request).then(response => {
try {
const obj = JSON.parse(response.body);
if (obj.code === 0) {
const days = obj.data?.consecutiveDay ?? "未知";
const bonus = obj.data?.bonus ?? "未知";
$notify("老百姓大药房签到成功", "", `已签到${days}天,获得积分:${bonus}`);
} else if (obj.message) {
$notify("老百姓大药房签到失败", "", obj.message);
} else {
$notify("老百姓大药房签到返回异常", "", response.body);
}
} catch (e) {
console.log("解析失败: " + e);
$notify("老百姓大药房签到异常", "", response.body);
}
$done();
}, err => {
console.log("请求异常: " + JSON.stringify(err));
$notify("老百姓大药房签到失败", "网络异常", JSON.stringify(err));
$done();
});
}