Authored by ccbikai

完善框架

@@ -33,8 +33,9 @@ app.locals.version = pkg.version; @@ -33,8 +33,9 @@ app.locals.version = pkg.version;
33 // 全局注册library 33 // 全局注册library
34 yohoLib.global(config); 34 yohoLib.global(config);
35 35
36 -// 指定libray目录 36 +// 指定 doraemon, utils 目录
37 global.utils = path.resolve('./utils'); 37 global.utils = path.resolve('./utils');
  38 +global.doraemon = path.resolve('./doraemon');
38 39
39 const logger = global.yoho.logger; 40 const logger = global.yoho.logger;
40 41
@@ -52,7 +53,7 @@ app.use(favicon(path.join(__dirname, '/public/favicon.ico'))); @@ -52,7 +53,7 @@ app.use(favicon(path.join(__dirname, '/public/favicon.ico')));
52 app.use(express.static(path.join(__dirname, 'public'))); 53 app.use(express.static(path.join(__dirname, 'public')));
53 app.use(bodyParser.json()); 54 app.use(bodyParser.json());
54 app.use(bodyParser.urlencoded({ 55 app.use(bodyParser.urlencoded({
55 - extended: false 56 + extended: true
56 })); 57 }));
57 app.use(cookieParser()); 58 app.use(cookieParser());
58 59
1 'use strict'; 1 'use strict';
2 -require('../app');  
3 const _ = require('lodash'); 2 const _ = require('lodash');
4 const camelCase = global.yoho.camelCase; 3 const camelCase = global.yoho.camelCase;
5 const helpers = global.yoho.helpers; 4 const helpers = global.yoho.helpers;
@@ -85,7 +84,8 @@ exports.processProductList = (list, options) => { @@ -85,7 +84,8 @@ exports.processProductList = (list, options) => {
85 height: 388, 84 height: 388,
86 isApp: false, 85 isApp: false,
87 showPoint: true, 86 showPoint: true,
88 - gender: '2,3' 87 + gender: '2,3',
  88 + yhChannel: ''
89 }, options); 89 }, options);
90 list = camelCase(list); 90 list = camelCase(list);
91 91
@@ -122,7 +122,7 @@ exports.processProductList = (list, options) => { @@ -122,7 +122,7 @@ exports.processProductList = (list, options) => {
122 122
123 // 如果还未赋值,则取第一个skc产品的默认图片 123 // 如果还未赋值,则取第一个skc产品的默认图片
124 if (!flag) { 124 if (!flag) {
125 - product.defaultImages = _procProductImg(product.goodsList[0], product.gender, options.yh_channel); 125 + product.defaultImages = _procProductImg(product.goodsList[0], product.gender, options.yhChannel);
126 } 126 }
127 127
128 product.isSoonSoldOut = product.isSoonSoldOut === 'Y'; 128 product.isSoonSoldOut = product.isSoonSoldOut === 'Y';
@@ -253,7 +253,7 @@ exports.processFilter = (list, options) => { @@ -253,7 +253,7 @@ exports.processFilter = (list, options) => {
253 subs: [] 253 subs: []
254 }; 254 };
255 255
256 - if (key === 'group_sort' || !filtersType[key]) { 256 + if (key === 'groupSort' || !filtersType[key]) {
257 return; 257 return;
258 } 258 }
259 259