Authored by 陈轩

im fix

@@ -16,7 +16,7 @@ const chatQa = require(`${cRoot}/chatQa`); // 问题搜索列表页 @@ -16,7 +16,7 @@ const chatQa = require(`${cRoot}/chatQa`); // 问题搜索列表页
16 // middlware 16 // middlware
17 17
18 const authGuard = require('../../doraemon/middleware/auth'); 18 const authGuard = require('../../doraemon/middleware/auth');
19 -const disableBFCache = require('../../doraemon/middleware/disable-bfcache'); 19 +const disableBFCache = require('../../doraemon/middleware/disable-BFCache');
20 20
21 // Your controller here 21 // Your controller here
22 router.get('/im', disableBFCache, chat.appAdapter, authGuard, chat.page); 22 router.get('/im', disableBFCache, chat.appAdapter, authGuard, chat.page);
@@ -20,13 +20,11 @@ module.exports = () => { @@ -20,13 +20,11 @@ module.exports = () => {
20 } 20 }
21 21
22 // app 特殊读法 22 // app 特殊读法
23 - if (!req.user.uid && req.yoho.isApp) {  
24 let userAgent = _.get(req.headers, 'user-agent', ''); 23 let userAgent = _.get(req.headers, 'user-agent', '');
25 24
26 - if (userAgent.indexOf('YohoBuy') >= 0) { 25 + if (!req.user.uid && userAgent.indexOf('YohoBuy') >= 0) {
27 req.user.uid = req.cookies._YOHOUID || 0; 26 req.user.uid = req.cookies._YOHOUID || 0;
28 } 27 }
29 - }  
30 28
31 next(); 29 next();
32 }; 30 };