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