Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
fix: 用户信息显示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
catlair committed Jun 19, 2021
1 parent 6e5dd48 commit bb39524
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/config/level.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"v1.0.3"
"v1.1.1"
6 changes: 2 additions & 4 deletions src/dailyTask/homeVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ class HomeVideo {

async getRecommendVideoCard() {
const $$ = await this.page.$$('.rcmd-box-wrap .rcmd-box .info-box img');
//只有前6个是需要的
logger.trace('获取到的视频长度', $$.length);
$$.length = 6;
//长度减1
// 5是长度减1
return $$[_.random(5)];
}

Expand All @@ -55,7 +53,7 @@ class HomeVideo {
const $video = await this.getRecommendVideoCard();
await this.page.util.wt(2, 5);
logger.trace('点击视频');
await $video.evaluate(node => node.click());
await $video.evaluate((node: HTMLElement) => node.click());
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/dailyTask/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export async function getUser(page: Page, logger: Logger) {
当前等级:${current_level} ${
DailyTask.isStopCoin ? '[达到目标等级]' : ''
}
距离升级还需要经验:${next_exp - current_exp}
距离升级还需要经验:${
<string | number>next_exp === '--'
? '0 [以达最高等级]'
: next_exp - current_exp
}
剩余硬币数:${money}`);
return res;
}
Expand Down

0 comments on commit bb39524

Please sign in to comment.