Showing
1 changed file
with
13 additions
and
9 deletions
@@ -27,7 +27,7 @@ const _ = require('lodash'); | @@ -27,7 +27,7 @@ const _ = require('lodash'); | ||
27 | 27 | ||
28 | const uuid = require('uuid'); | 28 | const uuid = require('uuid'); |
29 | 29 | ||
30 | -const redisStore = redis(session); | 30 | +const RedisStore = redis(session); |
31 | 31 | ||
32 | // 全局注册library | 32 | // 全局注册library |
33 | yohoLib.global(config); | 33 | yohoLib.global(config); |
@@ -50,6 +50,16 @@ exports.createApp = async (app) => { | @@ -50,6 +50,16 @@ exports.createApp = async (app) => { | ||
50 | app.use(devtools()); | 50 | app.use(devtools()); |
51 | } | 51 | } |
52 | 52 | ||
53 | + app.use('/crm/common/ok.jsp', (req, res) => { | ||
54 | + res.status(200).end(); | ||
55 | + }); | ||
56 | + app.head('*', (req, res) => { | ||
57 | + res.status(200).end(); | ||
58 | + }); | ||
59 | + | ||
60 | + app.use(favicon(path.join(__dirname, '/public/favicon.ico'))); | ||
61 | + app.use(express.static(path.join(__dirname, 'public'))); | ||
62 | + | ||
53 | // 添加请求上下文 | 63 | // 添加请求上下文 |
54 | app.use(global.yoho.httpCtx()); | 64 | app.use(global.yoho.httpCtx()); |
55 | 65 | ||
@@ -63,8 +73,6 @@ exports.createApp = async (app) => { | @@ -63,8 +73,6 @@ exports.createApp = async (app) => { | ||
63 | helpers: _.assign(global.yoho.helpers, require('./utils/helpers')) | 73 | helpers: _.assign(global.yoho.helpers, require('./utils/helpers')) |
64 | })); | 74 | })); |
65 | 75 | ||
66 | - app.use(favicon(path.join(__dirname, '/public/favicon.ico'))); | ||
67 | - app.use(express.static(path.join(__dirname, 'public'))); | ||
68 | app.use(bodyParser.json()); | 76 | app.use(bodyParser.json()); |
69 | app.use(bodyParser.urlencoded({ | 77 | app.use(bodyParser.urlencoded({ |
70 | extended: true | 78 | extended: true |
@@ -77,12 +85,12 @@ exports.createApp = async (app) => { | @@ -77,12 +85,12 @@ exports.createApp = async (app) => { | ||
77 | saveUninitialized: true, | 85 | saveUninitialized: true, |
78 | unset: 'destroy', | 86 | unset: 'destroy', |
79 | secret: '82dd7e724f2c6870472c89dfa43cf48d', | 87 | secret: '82dd7e724f2c6870472c89dfa43cf48d', |
80 | - name: 'yohoblk_session', | 88 | + name: 'yohoblk_session2', |
81 | cookie: { | 89 | cookie: { |
82 | domain: 'yohoblk.com', | 90 | domain: 'yohoblk.com', |
83 | httpOnly: false | 91 | httpOnly: false |
84 | }, | 92 | }, |
85 | - store: new redisStore(config.redis.session) | 93 | + store: new RedisStore(config.redis.session) |
86 | })); | 94 | })); |
87 | 95 | ||
88 | app.use((req, res, next) => { | 96 | app.use((req, res, next) => { |
@@ -115,10 +123,6 @@ exports.createApp = async (app) => { | @@ -115,10 +123,6 @@ exports.createApp = async (app) => { | ||
115 | await require('./doraemon/middleware/ssr')(app); | 123 | await require('./doraemon/middleware/ssr')(app); |
116 | require('./dispatch')(app); | 124 | require('./dispatch')(app); |
117 | 125 | ||
118 | - app.use('/crm/common/ok.jsp', (req, res) => { | ||
119 | - res.status(204).end(); | ||
120 | - }); | ||
121 | - | ||
122 | app.all('*', errorHanlder.notFound()); // 404 | 126 | app.all('*', errorHanlder.notFound()); // 404 |
123 | 127 | ||
124 | // YOHO 后置中间件 | 128 | // YOHO 后置中间件 |
-
Please register or login to post a comment