()
| 75 | } |
| 76 | |
| 77 | async run() { |
| 78 | |
| 79 | const cachedToken = this.getCachedToken(); |
| 80 | if (cachedToken) { |
| 81 | this.ck = cachedToken; |
| 82 | $.log(`账号[${this.index}] 使用缓存token验证`); |
| 83 | await this.user_info(); |
| 84 | } |
| 85 | |
| 86 | if (!this.ckStatus) { |
| 87 | this.removeCachedToken(); |
| 88 | await this.loginByWxCode() |
| 89 | if (!this.ckStatus) return |
| 90 | await this.user_info() |
| 91 | } |
| 92 | if (!this.ckStatus) return |
| 93 | await this.getLoginUrl() |
| 94 | if (this.activityOrigin) { |
| 95 | await this.getActivityToken() |
| 96 | await this.activityIndex() |
| 97 | } |
| 98 | |
| 99 | } |
| 100 | getCachedToken() { |
| 101 | const cache = readTokenCache(); |
| 102 | return cache[this.wcsid]?.accessToken || ""; |
no test coverage detected