|
|
@ -230,6 +230,7 @@ router.post('/savetask/', async (req, res) => { |
|
|
|
let name = req.body.name, |
|
|
|
let name = req.body.name, |
|
|
|
task_id = req.body.task_id, |
|
|
|
task_id = req.body.task_id, |
|
|
|
task_result = req.body.task_result, |
|
|
|
task_result = req.body.task_result, |
|
|
|
|
|
|
|
task_status = req.body.status, |
|
|
|
sign = req.body.sign; |
|
|
|
sign = req.body.sign; |
|
|
|
|
|
|
|
|
|
|
|
let data = {code: 0, message: ''}; |
|
|
|
let data = {code: 0, message: ''}; |
|
|
@ -261,11 +262,15 @@ router.post('/savetask/', async (req, res) => { |
|
|
|
task_result: task_result |
|
|
|
task_result: task_result |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof(task_status) != 'undefined' && task_status == 'failed') { |
|
|
|
|
|
|
|
paramsCheck.status = task_status; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let mySign = common.sign(paramsCheck, task.token); |
|
|
|
let mySign = common.sign(paramsCheck, task.token); |
|
|
|
if (mySign.toLowerCase() != sign.toLowerCase()) { |
|
|
|
if (mySign.toLowerCase() != sign.toLowerCase()) { |
|
|
|
data.message = `签名 ${sign} 不匹配,请确保token正确及签名方法跟文档一致`; |
|
|
|
data.message = `签名 ${sign} 不匹配,请确保token正确及签名方法跟文档一致`; |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
let saved = heroUnion.saveTaskById(name, task_id, task_result); |
|
|
|
let saved = heroUnion.saveTaskById(name, task_id, task_result, task_status); |
|
|
|
if (saved) { |
|
|
|
if (saved) { |
|
|
|
data.code = 1; |
|
|
|
data.code = 1; |
|
|
|
data.message = '保存任务数据完成'; |
|
|
|
data.message = '保存任务数据完成'; |
|
|
|