Authored by 李奇

catch修改

... ... @@ -16,8 +16,9 @@ const article = {
* 文章列表
* @param req
* @param res
* @param next
*/
list(req, res) {
list(req, res, next) {
const query = req.query;
const actId = query.actId;
const pageNo = query.pageNo || 1;
... ... @@ -80,7 +81,8 @@ const article = {
message: GET_SUCCESS
});
});
});
})
.catch(next);
},
... ... @@ -88,8 +90,9 @@ const article = {
* 发布文章
* @param req
* @param res
* @param next
*/
publish(req, res) {
publish(req, res, next) {
let newId;
let errorMsg = '';
const actId = req.body.actId;
... ... @@ -130,15 +133,17 @@ const article = {
},
message: POST_SUCCESS
});
});
})
.catch(next);
},
/**
* 查询单个article详情
* @param req
* @param res
* @param next
*/
querySingle(req, res) {
querySingle(req, res, next) {
let errorMsg = '';
const actId = req.query.actId;
const articleId = req.query.articleId;
... ... @@ -178,15 +183,17 @@ const article = {
data: final_result,
message: GET_SUCCESS
});
});
})
.catch(next);
},
/**
* 文章点赞
* @param req
* @param res
* @param next
*/
like(req, res) {
like(req, res, next) {
const actId = req.body.actId;
const articleId = req.body.articleId;
... ... @@ -207,7 +214,8 @@ const article = {
code: 200,
message: POST_SUCCESS
});
});
})
.catch(next);
}
};
... ...
... ... @@ -45,6 +45,7 @@ const smsController = {
* 发送短信验证码
* @param req
* @param res
* @param next
* @returns {*|boolean}
*/
sendCode(req, res, next) {
... ... @@ -114,7 +115,8 @@ const smsController = {
return;
}
next();
});
})
.catch(next);
}
};
... ...
... ... @@ -14,8 +14,9 @@ const userController = {
* 获取用户信息
* @param req
* @param res
* @param next
*/
userInfo(req, res) {
userInfo(req, res, next) {
const mobile = _.get(req.session, 'smsSend.mobile', '');
req.ctx(UserModel).getUser(mobile)
... ... @@ -60,9 +61,11 @@ const userController = {
data: _.assign(userInfo, {id}),
message: GET_USER_INFO_SUCCESS
});
});
})
.catch(next);
}
});
})
.catch(next);
}
};
... ...