()
| 256 | } |
| 257 | |
| 258 | async doCheckin() { |
| 259 | if (!this.checkinId) { |
| 260 | $.log(`账号[${this.index}] 未获取到签到活动,跳过`); |
| 261 | return; |
| 262 | } |
| 263 | if (this.isCheckin) { |
| 264 | $.log(`账号[${this.index}] 今日已签到`); |
| 265 | return; |
| 266 | } |
| 267 | if (!this.isOpen) { |
| 268 | $.log(`账号[${this.index}] 签到活动未开启`); |
| 269 | return; |
| 270 | } |
| 271 | |
| 272 | try { |
| 273 | const data = await this.request({ |
| 274 | apiPath: "wscump/checkin/checkinV2.json", |
| 275 | query: { checkinId: this.checkinId }, |
| 276 | }); |
| 277 | const award = (data?.list || []) |
| 278 | .map((item) => item?.infos?.title || item?.infos?.desc || "") |
| 279 | .filter(Boolean) |
| 280 | .join(", "); |
| 281 | $.log(`账号[${this.index}] 签到成功: ${data?.desc || ""}${award ? ` ${award}` : ""}`); |
| 282 | } catch (e) { |
| 283 | const message = String(e.message || e); |
| 284 | if (/已签到|已经签到|重复|今日.*签|参与次数/.test(message)) { |
| 285 | $.log(`账号[${this.index}] 今日已签到`); |
| 286 | return; |
| 287 | } |
| 288 | $.log(`账号[${this.index}] 签到失败: ${message}`); |
| 289 | if (e.code === -1 || e.code === 40010 || e.code === 40009 || /登录|token|access/i.test(message)) this.removeCachedToken(); |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | !(async () => { |
no test coverage detected