(method, urlPath, options = {})
| 200 | } |
| 201 | |
| 202 | async requestWithRelogin(method, urlPath, options = {}) { |
| 203 | await this.ensureLogin(); |
| 204 | const res = await apiRequest(method, urlPath, { ...options, token: this.token }); |
| 205 | if (Number(res?.code) === -3 && this.openid) { |
| 206 | $.log(`账号[${this.index}] token失效,重新登录`); |
| 207 | this.removeToken(); |
| 208 | await this.login(); |
| 209 | return apiRequest(method, urlPath, { ...options, token: this.token }); |
| 210 | } |
| 211 | return res; |
| 212 | } |
| 213 | |
| 214 | async getUserInfo() { |
| 215 | try { |
no test coverage detected