Authored by 郭成尧

'brand代码优化'

... ... @@ -29,7 +29,7 @@ module.exports = {
return api.get('', {
method: 'app.brand.newBrandList',
yh_channel: yhChannel[params.channel].channel
});
}, {code: 200, cache: true});
},
/**
... ... @@ -39,6 +39,6 @@ module.exports = {
getCateListData(params) {
return api.get('', Object.assign(params, {
method: 'app.sort.get'
}));
}, {code: 200, cache: true}));
}
};
... ...
... ... @@ -55,10 +55,10 @@ const getBrandListData = params => {
let finalResult = {};
return brandApi.getBrandListOriginData(params).then(result => {
if (result.code === 200 && result.data) {
if (result.data) {
Object.assign(finalResult, handleBrandList(result.data.all_list));
} else {
logger.error('getBrandListOriginData api code no 200 or data is null');
logger.error('getBrandListOriginData api data is null');
}
return finalResult;
... ... @@ -72,11 +72,7 @@ const getBrandListData = params => {
*/
const getCateListData = params => {
return brandApi.getCateListData(params).then(result => {
if (result.code === 200) {
return camelCase(result);
} else {
logger.error('getCateListData api code no 200 or data is null');
}
return camelCase(result);
});
};
... ...