Authored by 郭成尧

'routerget'

... ... @@ -22,8 +22,8 @@ module.exports = {
/* 获取资讯列表数据 */
getEditorialList: (req, res, next) => {
let params = {
page: req.body.page,
channel: req.body.channel,
page: req.query.page,
channel: req.query.channel,
uid: req.user.uid
};
... ...
... ... @@ -19,7 +19,7 @@ const editorialList = params => {
let finalResult = {};
return editorialListApi.getEditorialListData(params).then(result => {
if (result.data.list) {
if (result.data && result.data.list) {
Object.assign(finalResult, {
data: {
list: result.data.list.artList,
... ... @@ -28,7 +28,7 @@ const editorialList = params => {
code: 200
});
} else {
logger.error('getEitorialListData api no result.data');
logger.error('getEitorialListData api no data');
}
return camelCase(finalResult);
... ...
... ... @@ -13,7 +13,7 @@ const router = expressRouter();
const editorial = require(`${cRoot}/index`);
router.get('/list', editorial.index); // 首页
router.post('/list.json', editorial.getEditorialList); // 获取资讯数据
router.get('/list.json', editorial.getEditorialList); // 获取资讯数据
// 详情controller
const detail = require(`${cRoot}/detail`);
... ...
... ... @@ -85,7 +85,8 @@
contentCode: contentCode.editorial.all,
editorialList: [],
page: 0,
scrollDisabled: false
scrollDisabled: false,
channel: qs.channel
};
},
watch: {
... ... @@ -97,11 +98,11 @@
/* 获取资讯列表数据 */
getNewsList() {
$.post({
$.get({
url: '/editorial/list.json',
data: {
page: this.page++,
channel: qs.channel || 'all'
channel: this.channel
}
}).done(result => {
if (result.code === 200) {
... ...