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)}`); }