Skip to content

Commit 2cd8711

Browse files
author
GideonSenku
committed
更新[京东到家](本地替换脚本即可),由于商店版更新(http-body),原仅支持TF可以在商店版使用
1 parent 9d62555 commit 2cd8711

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

jddj/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ daojia.jd.com
4141
2. 再配置重写规则:
4242
- Surge: 把两条远程脚本放到`[Script]`
4343
- QuanX: 把`jddj.cookie.js``jddj.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关)
44-
3. 手机浏览器打开`https://daojia.jd.com/html/index.html` 点击签到
44+
3. 手机App打开,`我的`> `签到有惊喜`>`签到`手机浏览器打开`https://daojia.jd.com/html/index.html`,`我的`> `签到有惊喜` >`签到`
4545
4. 系统提示: `获取Cookie: 成功`
46-
5. 把获取 Cookie 的脚本注释掉,不用再次运行签到脚本!大概率导致Cookie失效
47-
6. 测试版远程尝试,获取不到Cookie请采用本地脚本!
46+
5. 把获取 Cookie 的脚本注释掉
4847

4948
> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie.
5049

jddj/jddj.cookie.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
const cookieName = '京东到家'
2-
const signurlKey = 'chen_signurl_jddj'
32
const signheaderKey = 'chen_signheader_jddj'
43
const chen = init()
5-
const requrl = $request.url
64
if (this.$request) {
7-
const signurlVal = requrl
85
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)
6+
if (signheaderVal) {
137
chen.setdata(signheaderVal, signheaderKey)
148
chen.msg(cookieName, `获取Cookie: 成功`, ``)
159
}

jddj/jddj.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
const cookieName ='京东到家'
2-
const signurlKey = 'chen_signurl_jddj'
32
const signheaderKey = 'chen_signheader_jddj'
43
const chen = init()
54
const signurlVal = chen.getdata(signurlKey)
65
const signheaderVal = chen.getdata(signheaderKey)
76
sign()
87
function sign() {
9-
let url = {url: signurlVal,headers: JSON.parse(signheaderVal)}
8+
let url = {url: `https://daojia.jd.com/client?functionId=signin%2FuserSigninNew&body=%7B%7D`,headers: JSON.parse(signheaderVal)}
109
chen.get(url, (error, response, data) => {
1110
chen.log(`${cookieName}, data: ${data}`)
1211
let res = JSON.parse(data)
@@ -20,6 +19,9 @@ function sign() {
2019
subTitle = `签到结果: 失败`
2120
detail = `说明: ${res.msg}`
2221
}
22+
else if (!res.success&&res.code==-1){
23+
subTitle = `签到成功,请勿重复操作`
24+
}
2325
else{
2426
subTitle = `未知错误,截图日志`
2527
}

0 commit comments

Comments
 (0)