...
|
...
|
@@ -9,6 +9,7 @@ const sender = global.yoho.apmSender; |
|
|
const hostname = require('os').hostname();
|
|
|
const routeEncode = require('./route-encode');
|
|
|
const _ = require('lodash');
|
|
|
const config = global.yoho.config;
|
|
|
|
|
|
const forceNoCache = (res) => {
|
|
|
if (res) {
|
...
|
...
|
@@ -80,6 +81,18 @@ exports.serverError = () => { |
|
|
logger.error(err);
|
|
|
|
|
|
if (err && err.code === 401) {
|
|
|
|
|
|
res.clearCookie('_UID', {
|
|
|
domain: config.cookieDomain
|
|
|
});
|
|
|
res.clearCookie('_TOKEN', {
|
|
|
domain: config.cookieDomain
|
|
|
});
|
|
|
|
|
|
res.clearCookie('_SESSION_KEY', {
|
|
|
domain: config.cookieDomain
|
|
|
});
|
|
|
|
|
|
if (req.xhr) {
|
|
|
err.data = {refer: helpers.urlFormat('/signin.html', {refer: req.get('Referer') || ''})};
|
|
|
return res.json(err);
|
...
|
...
|
|