(task)
| 339 | } |
| 340 | |
| 341 | async submitTask(task) { |
| 342 | const id = task.id || task.configId; |
| 343 | if (!id) return false; |
| 344 | const res = await this.api("post", "/client/user/taskSub", { |
| 345 | data: { configId: id }, |
| 346 | }); |
| 347 | if (res.status === 200 && ok(res.data)) { |
| 348 | $.log(`账号[${this.index}] 任务提交成功: ${taskName(task)} ${res.data.msg || ""}`); |
| 349 | return true; |
| 350 | } |
| 351 | const msg = res.data?.msg || res.data?.message || res.text.slice(0, 500); |
| 352 | $.log(`账号[${this.index}] 任务提交失败: ${taskName(task)},${msg}`); |
| 353 | return false; |
| 354 | } |
| 355 | |
| 356 | async doDailyTasks(taskHome = null) { |
| 357 | const data = taskHome || (await this.queryTaskHome()); |
no test coverage detected