Authored by htoooth

健状性增强

... ... @@ -21,20 +21,11 @@ class AbstractAction {
this.renderContext = {};
}
echoJson(json) {
this.response.set('Content-Type', 'application/json; charset=utf-8;');
this.response.json(json);
}
/**
* 判断是否是AJAX请求
*
* @return boolean 如果是AJAX请求返回 true
*/
isAjax() {
return this.request.header('X-Requested-With') === 'XMLHttpRequest';
}
/**
* 设置入口
... ...
... ... @@ -67,21 +67,14 @@ class YohoAction extends AbstractAction {
* 根据用户访问的频道猜测用户性别
*/
guessUserGender() {
let gender = null;
let channel = this.getSessionChannel();
switch (channel) {
switch (this.getSessionChannel()) {
case 'boys':
gender = '1,3';
break;
return '1,3';
case 'girls':
gender = '2,3';
break;
return '2,3';
default:
gender = '1,2,3';
return '1,2,3';
}
return gender;
}
/**
... ...
... ... @@ -896,8 +896,9 @@ const _sizeInfoBoSort = (sizeInfoBo) => {
let sortAttr = [];
sizeInfoBo.sizeAttributeBos.forEach(val => {
console.dir(val.id, sizeBoList.sortAttributes[val.id]);
sortAttr.push(sizeBoList.sortAttributes[val.id]);
if (sizeBoList.sortAttributes[val.id]) {
sortAttr.push(sizeBoList.sortAttributes[val.id]);
}
});
sizeInfoBo.sizeBoList[sizek].sortAttributes = sortAttr;
... ... @@ -1197,7 +1198,7 @@ const _getSizeAttrByMaxSortId = (maxSortId, sizeList) => {
let sizeValues = [];
_.get(size, 'sortAttributes', []).forEach((sort) => {
if (!_.isNil(sort) && _.includes(attributeIds, sort.id)) {
if (_.includes(attributeIds, sort.id)) {
if (sort.sizeValue) {
sizeValues.push(
`${attributeNames[sort.id]} ${sort.sizeValue}cm`
... ...