Authored by 郭成尧

'资讯列表代码优化'

... ... @@ -30,6 +30,6 @@ module.exports = {
uid: params.uid || '0',
page: params.page,
limit: '10'
});
}, {code: 200, cache: true});
}
};
... ...
... ... @@ -7,7 +7,6 @@
'use strict';
const logger = global.yoho.logger;
const api = global.yoho.API;
const editorialListApi = require('./list-api');
const camelCase = global.yoho.camelCase;
... ... @@ -19,19 +18,17 @@ const camelCase = global.yoho.camelCase;
const editorialList = params => {
let finalResult = {};
return api.all([
editorialListApi.getEditorialListData(params)
]).then(result => {
if (result[0].code === 200 && result[0].data.list) {
return editorialListApi.getEditorialListData(params).then(result => {
if (result.data.list) {
Object.assign(finalResult, {
data: {
list: result[0].data.list.artList,
totalPage: result[0].data.totalPage
list: result.data.list.artList,
totalPage: result.data.totalPage
},
code: 200
});
} else {
logger.error('getEitorialListData api code no 200');
logger.error('getEitorialListData api no result.data');
}
return camelCase(finalResult);
... ...