()
| 326 | } |
| 327 | |
| 328 | async run() { |
| 329 | const cached = this.getCachedToken(); |
| 330 | if (cached) { |
| 331 | this.applyToken(cached); |
| 332 | this.log(`使用缓存token ${shortToken(this.token)}`); |
| 333 | if (!(await this.checkToken())) { |
| 334 | this.removeCachedToken(); |
| 335 | this.log("缓存token失效,重新登录"); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | if (!this.token) await this.login(); |
| 340 | if (!this.token) { |
| 341 | this.summary.sign = "登录失败"; |
| 342 | return this.summary; |
| 343 | } |
| 344 | |
| 345 | await this.getMemberInfo(); |
| 346 | const done = await this.tryMemberCheckIn(); |
| 347 | if (!done) await this.tryTaskSign(); |
| 348 | return this.summary; |
| 349 | } |
| 350 | |
| 351 | async checkToken() { |
| 352 | try { |
no test coverage detected