MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / receiveTask

Method receiveTask

wxapp/ykb_all.js:522–533  ·  view source on GitHub ↗
(taskDetail, sourceTask)

Source from the content-addressed store, hash-verified

520 }
521
522 async receiveTask(taskDetail, sourceTask) {
523 const userTaskId = taskDetail?.UserTaskId || taskDetail?.UserTaskID || sourceTask?.UserTaskID || "";
524 if (!userTaskId) throw new Error("缺少 UserTaskId");
525 const data = await this.request({
526 method: "POST",
527 apiPath: "/hdb/api/v1/ClientTask/ReceiveTaskRewards",
528 data: { UserTaskId: userTaskId },
529 });
530 const text = rewardText(data?.Rewards || data?.RewardList || []);
531 this.summary.sign = `任务奖励已领取${text ? `: ${text}` : ""}`;
532 this.log(`领取任务奖励成功${text ? `: ${text}` : ""}`);
533 }
534
535 async handleTask(task) {
536 const name = task.TaskName || task.Name || task.TaskID || "未知任务";

Callers 1

handleTaskMethod · 0.95

Calls 3

requestMethod · 0.95
logMethod · 0.95
rewardTextFunction · 0.70

Tested by

no test coverage detected