|
|
@ -243,7 +243,16 @@ router.post('/savetask/', async (req, res) => { |
|
|
|
data.message = '任务编号task_id格式错误,请使用接口/api/gettask/返回数据里的任务id属性值'; |
|
|
|
data.message = '任务编号task_id格式错误,请使用接口/api/gettask/返回数据里的任务id属性值'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//检查爬虫是否存在及其状态
|
|
|
|
|
|
|
|
if (!data.message) { |
|
|
|
|
|
|
|
let heroBot = heroUnion.getHeroByName(name); |
|
|
|
|
|
|
|
if (!heroBot || heroBot.status == 'offline') { |
|
|
|
|
|
|
|
data.message = `爬虫${name}不存在或已下线`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//签名检查,如果通过则保存任务数据
|
|
|
|
//签名检查,如果通过则保存任务数据
|
|
|
|
|
|
|
|
if (!data.message) { |
|
|
|
let task = heroUnion.getTaskById(task_id); |
|
|
|
let task = heroUnion.getTaskById(task_id); |
|
|
|
if (task) { |
|
|
|
if (task) { |
|
|
|
let paramsCheck = { |
|
|
|
let paramsCheck = { |
|
|
@ -267,6 +276,7 @@ router.post('/savetask/', async (req, res) => { |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
data.message = `任务${task_id}不存在`; |
|
|
|
data.message = `任务${task_id}不存在`; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return res.status(200).json(data); |
|
|
|
return res.status(200).json(data); |
|
|
|
}); |
|
|
|
}); |
|
|
|