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