(taskCode)
| 205 | } |
| 206 | |
| 207 | async completeTask(taskCode) { |
| 208 | const headers = taskSignHeaders({ taskCode }); |
| 209 | const result = await this.api("GET", `/v1/complete-task/${taskCode}`, { taskCode }, headers); |
| 210 | if (Number(result?.code) === 20043 && String(result?.msg || "").includes("已完成")) { |
| 211 | this.log(`签到上报 ${taskCode}: 今日已完成`); |
| 212 | return result.msg; |
| 213 | } |
| 214 | const data = this.assertOk(result, `完成任务 ${taskCode}`); |
| 215 | this.log(`签到上报 ${taskCode}: ${data || "成功"}`); |
| 216 | return data; |
| 217 | } |
| 218 | |
| 219 | async sign() { |
| 220 | const tasks = await this.queryTasks(); |
no test coverage detected