Authored by yyq

Merge branch 'feature/qps' of git.yoho.cn:fe/yohobuy-node into feature/qps

@@ -70,15 +70,11 @@ const link = (req, res, next) => { @@ -70,15 +70,11 @@ const link = (req, res, next) => {
70 res.render('link', responseData); 70 res.render('link', responseData);
71 }).catch(next); 71 }).catch(next);
72 }; 72 };
73 -const test = (req, res) => {  
74 - res.send('hi');  
75 -};  
76 73
77 module.exports = { 74 module.exports = {
78 yohobuy, 75 yohobuy,
79 newpower, 76 newpower,
80 contact, 77 contact,
81 privacy, 78 privacy,
82 - link,  
83 - test 79 + link
84 }; 80 };
@@ -13,6 +13,5 @@ router.get('/newpower.html', aboutCtrl.newpower); @@ -13,6 +13,5 @@ router.get('/newpower.html', aboutCtrl.newpower);
13 router.get('/contact.html', aboutCtrl.contact); 13 router.get('/contact.html', aboutCtrl.contact);
14 router.get('/privacy.html', aboutCtrl.privacy); 14 router.get('/privacy.html', aboutCtrl.privacy);
15 router.get('/link.html', aboutCtrl.link); 15 router.get('/link.html', aboutCtrl.link);
16 -router.get('/test.html', aboutCtrl.test);  
17 16
18 module.exports = router; 17 module.exports = router;
@@ -67,8 +67,6 @@ router.get(['/index', '/'], tabsMiddleware.getCommonHeaderNew, indexController.i @@ -67,8 +67,6 @@ router.get(['/index', '/'], tabsMiddleware.getCommonHeaderNew, indexController.i
67 router.get('/index/newsAvatar', checkLogin, indexController.newsAvatar); 67 router.get('/index/newsAvatar', checkLogin, indexController.newsAvatar);
68 router.get('/index/async', checkLogin, indexController.asyncData); 68 router.get('/index/async', checkLogin, indexController.asyncData);
69 69
70 -// router.get(['/index', '/'], tabsMiddleware.getCommonHeader, indexController.index);  
71 -  
72 // 查看二维码 70 // 查看二维码
73 router.get('/QRcode', tabsMiddleware.getCommonHeader, personalController.QRcode); 71 router.get('/QRcode', tabsMiddleware.getCommonHeader, personalController.QRcode);
74 72
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <p class="title ucenter"></p> 2 <p class="title ucenter"></p>
3 <div class="user-thumb"> 3 <div class="user-thumb">
4 <div class="thumb-bg"> 4 <div class="thumb-bg">
5 - <img id="user-thumb"> 5 + <img id="user-thumb" src="{{image2 userThumb w=100 h=100}}">
6 </div> 6 </div>
7 </div> 7 </div>
8 {{# homeNav}} 8 {{# homeNav}}
@@ -1654,7 +1654,7 @@ exports.getCriteo = (glist) => { @@ -1654,7 +1654,7 @@ exports.getCriteo = (glist) => {
1654 // handlePagerData 1654 // handlePagerData
1655 exports.getSearchParams = params => { 1655 exports.getSearchParams = params => {
1656 1656
1657 - let mlimit = 59; 1657 + let mlimit = 39;
1658 1658
1659 if (params && params.limit) { 1659 if (params && params.limit) {
1660 1660
@@ -1668,7 +1668,7 @@ exports.getSearchParams = params => { @@ -1668,7 +1668,7 @@ exports.getSearchParams = params => {
1668 mlimit = 199; 1668 mlimit = 199;
1669 break; 1669 break;
1670 default: 1670 default:
1671 - mlimit = 59; 1671 + mlimit = 39;
1672 } 1672 }
1673 } 1673 }
1674 1674
@@ -77,7 +77,7 @@ module.exports = { @@ -77,7 +77,7 @@ module.exports = {
77 db: 'web-apm' 77 db: 'web-apm'
78 }, 78 },
79 useOneapm: false, 79 useOneapm: false,
80 - useCache: false, 80 + useCache: true,
81 memcache: { 81 memcache: {
82 master: ['127.0.0.1:11211'], 82 master: ['127.0.0.1:11211'],
83 slave: ['127.0.0.1:11211'], 83 slave: ['127.0.0.1:11211'],
@@ -92,7 +92,7 @@ module.exports = { @@ -92,7 +92,7 @@ module.exports = {
92 infoFile: { 92 infoFile: {
93 close: true, 93 close: true,
94 name: 'info', 94 name: 'info',
95 - level: 'error', 95 + level: 'info',
96 filename: 'logs/info.log', 96 filename: 'logs/info.log',
97 maxFiles: 14 97 maxFiles: 14
98 }, 98 },
@@ -28,6 +28,4 @@ module.exports = app => { @@ -28,6 +28,4 @@ module.exports = app => {
28 // 第三方,如广告联盟 28 // 第三方,如广告联盟
29 app.use('/3party', require('./apps/3party')); 29 app.use('/3party', require('./apps/3party'));
30 app.use('/service', require('./apps/service')); // 客服 30 app.use('/service', require('./apps/service')); // 客服
31 -  
32 - app.get('/benchmark', require('./mem'));  
33 }; 31 };
1 -const cache = global.yoho.cache;  
2 -const data = require('./test.json');  
3 -const benchmark = require('./utils/benchmark');  
4 -  
5 -const cachedSet = benchmark(cache.set, cache);  
6 -const cachedGet = benchmark(cache.get, cache);  
7 -  
8 -async function benchmarkMem(req, res) {  
9 - console.log('memcache write');  
10 -  
11 - for (let i = 0; i < 100; i++) {  
12 - await cachedSet(`cache:${1}`, data);  
13 - }  
14 -  
15 - console.log('memcache get');  
16 - for (let i = 0; i < 100; i++) {  
17 - let result = await cachedGet(`cache:${i}`);  
18 -  
19 - if (result) {  
20 - console.log('memcached get');  
21 - }  
22 - }  
23 -  
24 - res.json({code: 200, message: ''});  
25 -}  
26 -  
27 -module.exports = benchmarkMem;  
This diff could not be displayed because it is too large.
1 { 1 {
2 "name": "yohobuy-node", 2 "name": "yohobuy-node",
3 - "version": "5.9.94", 3 + "version": "5.9.93",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
55 "urlencode": "^1.1.0", 55 "urlencode": "^1.1.0",
56 "uuid": "^2.0.2", 56 "uuid": "^2.0.2",
57 "yoho-express-session": "^2.0.0", 57 "yoho-express-session": "^2.0.0",
58 - "yoho-node-lib": "=0.5.11", 58 + "yoho-node-lib": "=0.5.14",
59 "yoho-zookeeper": "^1.0.8" 59 "yoho-zookeeper": "^1.0.8"
60 }, 60 },
61 "devDependencies": { 61 "devDependencies": {
@@ -85,20 +85,6 @@ if (window.cookie('__NEW_USER')) { @@ -85,20 +85,6 @@ if (window.cookie('__NEW_USER')) {
85 }); 85 });
86 } 86 }
87 87
88 -// if (window.cookie('_UID')) {  
89 -// // 判断是否有新人专享  
90 -// $.ajax({  
91 -// type: 'GET',  
92 -// url: '/channel/isNewUserAjax',  
93 -// data: {},  
94 -// success: function(res) {  
95 -// if (!res.isNewUser) {  
96 -// $('.new-user').addClass('hide');  
97 -// }  
98 -// }  
99 -// });  
100 -// }  
101 -  
102 if (mChannel !== '') { 88 if (mChannel !== '') {
103 /** ***** 埋点 *******/ 89 /** ***** 埋点 *******/
104 // banner埋点 90 // banner埋点
This diff could not be displayed because it is too large.