()
| 63 | } |
| 64 | |
| 65 | async run() { |
| 66 | const cached = this.getCachedToken(); |
| 67 | if (cached) { |
| 68 | this.applyToken(cached); |
| 69 | $.log(`账号[${this.index}] 使用缓存token`); |
| 70 | if (!(await this.checkToken())) { |
| 71 | this.removeCachedToken(); |
| 72 | $.log(`账号[${this.index}] 缓存token失效,重新登录`); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | if (!this.authorization) { |
| 77 | await this.loginByWxCode(); |
| 78 | if (!this.authorization) return; |
| 79 | } |
| 80 | |
| 81 | await this.getSignList(); |
| 82 | await this.doSign(); |
| 83 | await this.getUser(); |
| 84 | } |
| 85 | |
| 86 | getCachedToken() { |
| 87 | const cache = readTokenCache(); |
no test coverage detected