From fb1e15160c76de0bfb56d15da0a9da6d56a87e6e Mon Sep 17 00:00:00 2001 From: wisz2021 Date: Wed, 12 May 2021 09:52:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A9=E5=8A=9B=E7=81=AB?= =?UTF-8?q?=E7=88=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_syj.js | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/jd_syj.js b/jd_syj.js index f4fcb8cb..3e5d3502 100644 --- a/jd_syj.js +++ b/jd_syj.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://gitee.com/lxk0301 * @Date: 2020-11-27 09:19:21 * @Last Modified by: lxk0301 - * @Last Modified time: 2021-4-27 16:58:02 + * @Last Modified time: 2021-5-12 16:58:02 */ /* 赚京豆脚本,一:签到(一周签到可获得30京豆),二:做任务 天天领京豆(加速领京豆)、三:赚京豆-瓜分京豆 @@ -586,7 +586,8 @@ function helpFriendTuan(body) { "assistStartRecordId": body['assistStartRecordId'], "channel": body['channel'], } - $.get(taskUrl("vvipclub_distributeBean_assist", data), async (err, resp, data) => { + delete body['time']; + $.get(taskTuanUrl("vvipclub_distributeBean_assist", body), async (err, resp, data) => { try { if (err) { console.log(`${JSON.stringify(err)}`) @@ -618,7 +619,7 @@ function helpFriendTuan(body) { function getUserTuanInfo() { let body = {"paramData": {"channel": "FISSION_BEAN"}} return new Promise(resolve => { - $.get(taskUrl("distributeBeanActivityInfo", body), async (err, resp, data) => { + $.get(taskTuanUrl("distributeBeanActivityInfo", body), async (err, resp, data) => { try { if (err) { console.log(`${JSON.stringify(err)}`) @@ -666,7 +667,7 @@ function getUserTuanInfo() { function openTuan() { let body = {"activityIdEncrypted": $.tuanActId, "channel": "FISSION_BEAN"} return new Promise(resolve => { - $.get(taskUrl("vvipclub_distributeBean_startAssist", body), async (err, resp, data) => { + $.get(taskTuanUrl("vvipclub_distributeBean_startAssist", body), async (err, resp, data) => { try { if (err) { console.log(`${JSON.stringify(err)}`) @@ -760,7 +761,22 @@ function taskUrl(function_id, body = {}) { } } - +function taskTuanUrl(function_id, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&osVersion=5.0.0&clientVersion=3.1.3&fromType=wxapp×tamp=${new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000}`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "Host": "api.m.jd.com", + "Referer": "https://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html", + "Cookie": cookie, + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), + } + } +} function TotalBean() { return new Promise(async resolve => {