Authored by 毕凯

错误中间件修改

... ... @@ -32,8 +32,8 @@ exports.notFound = () => {
*/
exports.serverError = () => {
return (err, req, res, next) => {
if (!res.headersSent) {
logger.error(err);
if (!res.headersSent) {
if (req.xhr) {
return res.status(500).json({
code: 500,
... ...