From 380c502b5960fb1794ab385aa8fdd2e23c2b9304 Mon Sep 17 00:00:00 2001 From: catlair Date: Sun, 2 May 2021 13:45:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AC=E5=B8=81=E6=95=B0info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/globalVar.ts | 2 ++ src/dailyTask/upTask.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/config/globalVar.ts b/src/config/globalVar.ts index 6e3898b..0cd155e 100644 --- a/src/config/globalVar.ts +++ b/src/config/globalVar.ts @@ -19,6 +19,8 @@ export abstract class DailyTask { static readonly STAY_COINS = userConfig.stayCoins ?? 0; + static money = 0; + static excludesLiveRoom: number[] = userConfig.excludesLiveRoom || []; static includesLiveRoom: number[] = userConfig.includesLiveRoom || []; diff --git a/src/dailyTask/upTask.ts b/src/dailyTask/upTask.ts index bfab6c8..a33eee7 100644 --- a/src/dailyTask/upTask.ts +++ b/src/dailyTask/upTask.ts @@ -91,6 +91,9 @@ export class UPTask { } await this.closeUpPage(); + if (isStopCoin) { + logger.info('剩余硬币数', this.userNav?.money); + } return isStopCoin; } @@ -117,7 +120,7 @@ export class UPTask { const pageUrl = await this.page.url(); const includesWords = ['/video', 'bangumi', 'read/cv', 'audio/au']; const isIncludesWord = includesWords.some(word => pageUrl.includes(word)); - logger.info('剩余硬币数', this.userNav?.money || '未知'); + DailyTask.money = this.userNav?.money; if (!this.page.isClosed() && isIncludesWord) { await this.page.util.wt(2, 4); await this.page.close();