From a0140f26b52b26be5643c3769ee367b1a30326ae Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 19 Jan 2021 17:47:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=AC=E5=96=9C=E5=B7=A5?= =?UTF-8?q?=E5=8E=82=E8=BF=87=E6=9C=9F=E7=9A=84=E5=9B=A2=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E7=BB=A7=E7=BB=AD=E5=BC=80=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E5=9B=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_dreamFactory.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index 1d1175e6..aae57c17 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -894,6 +894,10 @@ async function tuanActivity() { const QueryTuanRes = await QueryTuan(activeId, tuanId); if (QueryTuanRes && QueryTuanRes.ret === 0) { const { tuanInfo } = QueryTuanRes.data; + if ((tuanInfo && tuanInfo[0]['endTime']) <= QueryTuanRes['nowTime']) { + $.log(`之前的团已过期,准备重新开团\n`) + await CreateTuan(); + } for (let item of tuanInfo) { const { realTuanNum, tuanNum, userInfo } = item; $.log(`\n开团情况:${realTuanNum}/${tuanNum}\n`); @@ -1024,6 +1028,7 @@ function CreateTuan() { data = JSON.parse(data); if (data['ret'] === 0) { console.log(`开团成功tuanId为\n${data.data['tuanId']}`); + $.tuanIds.push(data.data['tuanId']); } else { console.log(`异常:${JSON.stringify(data)}`); }