From bf39001c844d446b632727d5bed83b06545f9fed Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Wed, 6 Jan 2021 16:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20jd=5Fjoy=5Frun.js=E9=82=80?= =?UTF-8?q?=E8=AF=B7=E5=8A=A9=E5=8A=9B=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_joy_run.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/jd_joy_run.js b/jd_joy_run.js index 66e3d520..a8f414d7 100644 --- a/jd_joy_run.js +++ b/jd_joy_run.js @@ -246,12 +246,7 @@ async function invite(invite_pins) { console.log(`\n账号${$.index} [${UserName}] 开始给好友 [${item}] 进行邀请助力`) const data = await enterRoom(item); if (data) { - if (!data.success && data.errorCode === 'B0001') { - console.log('京东Cookie失效'); - $.msg($.name, `【提示】京东cookie已失效`, `京东账号${$.index} ${UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); - $.jdLogin = false; - break - } else { + if (data.success) { const { helpStatus } = data.data; console.log(`helpStatus ${helpStatus}`) if (helpStatus=== 'help_full') { @@ -277,6 +272,13 @@ async function invite(invite_pins) { } } $.jdLogin = true; + } else { + if (data.errorCode === 'B0001') { + console.log('京东Cookie失效'); + $.msg($.name, `【提示】京东cookie已失效`, `京东账号${$.index} ${UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); + $.jdLogin = false; + break + } } } } @@ -289,10 +291,11 @@ function enterRoom(invitePin) { headers.Cookie = cookie; headers.LKYLToken = $.LKYLToken; const options = { - url: `${JD_BASE_API}/enterRoom?reqSource=weapp&invitePin=${encodeURI(invitePin)}`, + url: `${JD_BASE_API}/enterRoom/h5?reqSource=weapp&invitePin=${encodeURI(invitePin)}&inviteSource=task_invite&shareSource=weapp&inviteTimeStamp=${Date.now()}`, + body: '{}', headers } - $.get(options, (err, resp, data) => { + $.post(options, (err, resp, data) => { try { if (err) { $.log(`${$.name} API请求失败`)