diff --git a/routes/index.js b/routes/index.js index 4ccba99..8c7ef3c 100644 --- a/routes/index.js +++ b/routes/index.js @@ -91,12 +91,10 @@ router.post('/deploy', function(req, res, next) { //部署完毕事件 router.post('/finsh', function(req, res, next) { - var parseMe = Object.keys(req.body)[0]; - var parsedParams = JSON.parse(parseMe); - if(parsedParams.name in startDeploy) { - let deployInfo=startDeploy[parsedParams] - dingding(`${parsedParams}|${deployInfo.description}自动部署成功,花费时间:${moment().diff(deployInfo.startTime, 'seconds', true)}秒`) - res.json({message:`仓库代码${parsedParams}部署成功`}) + if(req.body.name in startDeploy) { + let deployInfo=startDeploy[req.body.name] + dingding(`${req.body.name}|${deployInfo.description}自动部署成功,花费时间:${moment().diff(deployInfo.startTime, 'seconds', true)}秒`) + res.json({message:`仓库代码${req.body.name}部署成功`}) }else { error('参数异常,无法试别部署完毕事件') res.error()