()
| 457 | } |
| 458 | |
| 459 | async tryMemberCheckIn() { |
| 460 | try { |
| 461 | const detail = await this.request({ |
| 462 | apiPath: "/ykb_huiyuan/api/v1/MemberCheckIn/GetDetail", |
| 463 | params: monthRange(), |
| 464 | }); |
| 465 | const dailyReward = Array.isArray(detail?.RewardRules) |
| 466 | ? detail.RewardRules.find((item) => item.CycleType === "Daily") |
| 467 | : null; |
| 468 | const dailyText = dailyReward ? `${dailyReward.Amount}${dailyReward.RewardAlias || ""}` : "未知"; |
| 469 | this.log(`会员签到状态: 已连续${detail?.Days ?? 0}天 今日奖励=${dailyText}`); |
| 470 | |
| 471 | if (detail?.IsCheckIn) { |
| 472 | this.summary.sign = "今日已签到"; |
| 473 | this.log("今日已签到"); |
| 474 | return true; |
| 475 | } |
| 476 | |
| 477 | const result = await this.request({ |
| 478 | apiPath: "/ykb_huiyuan/api/v1/MemberCheckIn/Submit", |
| 479 | }); |
| 480 | const after = await this.request({ |
| 481 | apiPath: "/ykb_huiyuan/api/v1/MemberCheckIn/GetDetail", |
| 482 | params: monthRange(), |
| 483 | }); |
| 484 | this.summary.sign = `签到成功 signed=${!!after?.IsCheckIn}`; |
| 485 | this.log(`签到成功${result?.Message ? `: ${result.Message}` : ""} signed=${!!after?.IsCheckIn}`); |
| 486 | return true; |
| 487 | } catch (e) { |
| 488 | this.summary.sign = `会员签到失败: ${e.message || e}`; |
| 489 | this.log(`会员签到接口不可用,改用任务签到: ${e.message || e}`); |
| 490 | if (isAuthError(e)) this.removeCachedToken(); |
| 491 | return false; |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | async getTaskList(taskType = "AllTask") { |
| 496 | const data = await this.request({ |
no test coverage detected