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();