Authored by ccbikai

完善框架

... ... @@ -33,8 +33,9 @@ app.locals.version = pkg.version;
// 全局注册library
yohoLib.global(config);
// 指定libray目录
// 指定 doraemon, utils 目录
global.utils = path.resolve('./utils');
global.doraemon = path.resolve('./doraemon');
const logger = global.yoho.logger;
... ... @@ -52,7 +53,7 @@ app.use(favicon(path.join(__dirname, '/public/favicon.ico')));
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: false
extended: true
}));
app.use(cookieParser());
... ...
'use strict';
require('../app');
const _ = require('lodash');
const camelCase = global.yoho.camelCase;
const helpers = global.yoho.helpers;
... ... @@ -85,7 +84,8 @@ exports.processProductList = (list, options) => {
height: 388,
isApp: false,
showPoint: true,
gender: '2,3'
gender: '2,3',
yhChannel: ''
}, options);
list = camelCase(list);
... ... @@ -122,7 +122,7 @@ exports.processProductList = (list, options) => {
// 如果还未赋值,则取第一个skc产品的默认图片
if (!flag) {
product.defaultImages = _procProductImg(product.goodsList[0], product.gender, options.yh_channel);
product.defaultImages = _procProductImg(product.goodsList[0], product.gender, options.yhChannel);
}
product.isSoonSoldOut = product.isSoonSoldOut === 'Y';
... ... @@ -253,7 +253,7 @@ exports.processFilter = (list, options) => {
subs: []
};
if (key === 'group_sort' || !filtersType[key]) {
if (key === 'groupSort' || !filtersType[key]) {
return;
}
... ...