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