From 9a8b2a3bd6a153072d0a4d156dfc23dcdfe4ba00 Mon Sep 17 00:00:00 2001 From: any Date: Tue, 2 Feb 2021 22:14:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=A9=E9=99=8D?= =?UTF-8?q?=E7=88=86=E7=AB=B9=E4=B8=8D=E9=A2=86=E5=A5=96=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_nian.js | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/jd_nian.js b/jd_nian.js index 732e7a23..4b570825 100644 --- a/jd_nian.js +++ b/jd_nian.js @@ -1170,7 +1170,8 @@ function getSpecialGiftInfo() { } else { data = JSON.parse(data); if (data && data.data['bizCode'] === 0) { - console.log(`领奖成功,获得${data.data.result.score}爆竹🧨`) + await collectSpecialFinalScore() + // console.log(`领奖成功,获得${data.data.result.score}爆竹🧨`) }else{ console.log(data.data.bizMsg) } @@ -1243,6 +1244,53 @@ function collectSpecialScore(taskId, itemId, actionType = null, inviteId = null, }) } +function collectSpecialFinalScore() { + let temp = { + "ic": 1, + "rnd": getRnd(), + "inviteId": "-1", + "stealId": "-1" + } + const extraData = { + "jj": 6, + "buttonid": "jmdd-react-smash_0", + "sceneid": "homePageh5", + "appid": '50073' + } + let body = { + ...encode(temp, $.secretp, extraData), + "ic" : 1, + } + return new Promise(resolve => { + $.post(taskPostUrl("nian_collectSpecialGift", body, "nian_collectSpecialGift"), async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.code === 0) { + if (data.data && data.data.bizCode === 0) { + if (data.data.result && data.data.result.collectInfo && data.data.result.collectInfo.score) + console.log(`任务完成,获得${data.data.result.collectInfo.score}爆竹🧨`) + else + console.log(JSON.stringify(data)) + // $.userInfo = data.data.result.userInfo; + } else { + console.log(data.data.bizMsg) + } + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} function readShareCode() { console.log(`开始`) return new Promise(async resolve => {