()
| 161 | } |
| 162 | |
| 163 | async run() { |
| 164 | $.log(`\n账号[${this.index}] ${mask(this.account)}`); |
| 165 | this.token = this.getCachedToken(); |
| 166 | |
| 167 | if (this.token) { |
| 168 | $.log(`账号[${this.index}] 使用缓存 token`); |
| 169 | try { |
| 170 | const status = await this.signBanner(); |
| 171 | await this.handleStatus(status); |
| 172 | return; |
| 173 | } catch (e) { |
| 174 | $.log(`账号[${this.index}] 缓存失效: ${e.message || e}`); |
| 175 | this.removeToken(); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | await this.login(); |
| 180 | const status = await this.signBanner(); |
| 181 | await this.handleStatus(status); |
| 182 | } |
| 183 | |
| 184 | async handleStatus(status) { |
| 185 | if (status.signed) { |
no test coverage detected