Authored by 毕凯

一处多余中间件

Showing 1 changed file with 3 additions and 6 deletions
... ... @@ -79,9 +79,6 @@ if (!app.locals.devEnv) {
// 指定libray目录
global.utils = path.resolve('./utils');
// 添加请求上下文
app.use(global.yoho.httpCtx());
// 访问域名层级
app.set('subdomain offset', 3);
... ... @@ -105,9 +102,6 @@ app.use(compression());
require('./doraemon/middleware/yoho-session')(app);
// 添加请求上下文
app.use(global.yoho.httpCtx());
app.use((req, res, next) => {
req.user = {}; // 全局的用户数据
req.yoho = {}; // req和res绑定yoho对象,用于传递全局数据, 如req.yoho.channel等
... ... @@ -125,6 +119,9 @@ app.use((req, res, next) => {
next();
});
// 添加请求上下文
app.use(global.yoho.httpCtx());
// dispatcher
try {
const tdkUrl = require('./doraemon/middleware/redis-url');
... ...