Skip to content

Commit d92042b

Browse files
author
GideonSenku
committed
[京东到家]正式版
1 parent 89d4f1f commit d92042b

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

‎jddj/README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
> 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可
44
> 感谢 [@barry](https://t.me/barrymchen) 编写
5+
>
56
> 感谢 [@GideonSenku](https://github.com/GideonSenku) 对代码优化
67
78
## 配置 (Surge)
@@ -11,7 +12,7 @@
1112
daojia.jd.com
1213

1314
[Script]
14-
http-request ^https:\/\/daojia\.jd\.com\/client? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.cookie.js, requires-body=true
15+
^https:\/\/daojia.jd.com/client(.*?)functionId=signin(.*?)userSigninNewscript-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.cookie.js, requires-body=true
1516

1617
cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.js
1718
```
@@ -28,7 +29,7 @@ daojia.jd.com
2829
# ^https:\/\/daojia\.jd\.com\/client? url script-request-header jddj.cookie.js
2930

3031
# [TestFlight] QuanX v1.0.6-build195 及以后版本
31-
^https:\/\/daojia\.jd\.com\/client? url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.cookie.js
32+
^https:\/\/daojia.jd.com/client(.*?)functionId=signin(.*?)userSigninNew url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/jddj/jddj.cookie.js
3233

3334
[task_local]
3435
1 0 * * * jddj.js

‎jddj/jddj.cookie.js‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ const signurlKey = 'chen_signurl_jddj'
33
const signheaderKey = 'chen_signheader_jddj'
44
const chen = init()
55
const requrl = $request.url
6-
if ($request && $request.method != 'OPTIONS') {
7-
const signurlVal = requrl
8-
const signheaderVal = JSON.stringify($request.headers)
9-
const flag = requrl.includes('functionId=signinuserSigninNew')
10-
if (signurlVal&&signheaderVal&&flag) {
11-
chen.setdata(signurlVal, signurlKey)
12-
chen.setdata(signheaderVal, signheaderKey)
13-
chen.msg(cookieName, `获取Cookie: 成功`, ``)
6+
if (this.$request) {
7+
const signurlVal = requrl
8+
const signheaderVal = JSON.stringify($request.headers)
9+
chen.log(`URL:${signurlVal}`)
10+
const flag = requrl.includes('userSigninNew')
11+
if (flag) {
12+
chen.setdata(signurlVal, signurlKey)
13+
chen.setdata(signheaderVal, signheaderKey)
14+
chen.msg(cookieName, `获取Cookie: 成功`, ``)
15+
}
1416
}
15-
}
1617
function init() {
1718
isSurge = () => {
1819
return undefined === this.$httpClient ? false : true

‎jddj/jddj.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ function sign() {
1616
if (res.success&&res.result.points) {
1717
subTitle = `签到结果:成功`
1818
detail = `获取鲜豆:${res.result.points}`
19-
} else if(res.success==false){
19+
} else if(!res.success){
2020
subTitle = `签到结果: 重复签到`
2121
detail = `说明: ${res.msg}`
2222
}
2323
chen.msg(title, subTitle, detail)
2424
})
25-
chen.done()
26-
}
25+
}
2726

2827
function init() {
2928
isSurge = () => {

0 commit comments

Comments
 (0)