Authored by 毕凯

给模板增加 isDevelop 变量

... ... @@ -25,7 +25,7 @@ app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(function(req, res, next) {
res.locals.env = app.get('env');
res.locals.isDevelop = app.get('env') === 'development';
next();
});
... ...
... ... @@ -8,7 +8,7 @@ exports.apiError = (err) => {
// 控制返回到页面的错误信息
exports.webError = (err, res) => {
if (res.locals.env === 'development') {
if (res.locals.isDevelop) {
console.log(err);
err = {};
}
... ...