()
| 71 | } |
| 72 | |
| 73 | async run() { |
| 74 | const cached = this.getCachedToken(); |
| 75 | if (cached) { |
| 76 | this.applyToken(cached); |
| 77 | $.log(`账号[${this.index}] 使用缓存token`); |
| 78 | if (!(await this.checkToken())) { |
| 79 | this.removeCachedToken(); |
| 80 | $.log(`账号[${this.index}] 缓存token失效,重新登录`); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | if (!this.token) { |
| 85 | await this.loginByWxCode(); |
| 86 | if (!this.token) return; |
| 87 | } |
| 88 | |
| 89 | await this.showCheckinPage(); |
| 90 | await this.doCheckin(); |
| 91 | await this.getPoints(); |
| 92 | } |
| 93 | |
| 94 | getCachedToken() { |
| 95 | const cache = readTokenCache(); |
no test coverage detected