...
|
...
|
@@ -4,6 +4,7 @@ |
|
|
*/
|
|
|
const headerModel = require('../models/header');
|
|
|
const logger = global.yoho.logger;
|
|
|
const helpers = global.yoho.helpers;
|
|
|
|
|
|
const forceNoCache = (res) => {
|
|
|
if (res) {
|
...
|
...
|
@@ -48,6 +49,15 @@ exports.serverError = () => { |
|
|
|
|
|
logger.error(`error at path: ${req.url}`);
|
|
|
logger.error(err);
|
|
|
|
|
|
if (err && err.code === 401) {
|
|
|
if (req.xhr) {
|
|
|
return res.json(err);
|
|
|
} else {
|
|
|
return res.redirect(helpers.urlFormat('/signin.html', {refer: req.fullUrl()}));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (!res.headersSent) {
|
|
|
if (req.xhr) {
|
|
|
return res.status(500).json({
|
...
|
...
|
|