Showing
4 changed files
with
9 additions
and
8 deletions
@@ -22,8 +22,8 @@ module.exports = { | @@ -22,8 +22,8 @@ module.exports = { | ||
22 | /* 获取资讯列表数据 */ | 22 | /* 获取资讯列表数据 */ |
23 | getEditorialList: (req, res, next) => { | 23 | getEditorialList: (req, res, next) => { |
24 | let params = { | 24 | let params = { |
25 | - page: req.body.page, | ||
26 | - channel: req.body.channel, | 25 | + page: req.query.page, |
26 | + channel: req.query.channel, | ||
27 | uid: req.user.uid | 27 | uid: req.user.uid |
28 | }; | 28 | }; |
29 | 29 |
@@ -19,7 +19,7 @@ const editorialList = params => { | @@ -19,7 +19,7 @@ const editorialList = params => { | ||
19 | let finalResult = {}; | 19 | let finalResult = {}; |
20 | 20 | ||
21 | return editorialListApi.getEditorialListData(params).then(result => { | 21 | return editorialListApi.getEditorialListData(params).then(result => { |
22 | - if (result.data.list) { | 22 | + if (result.data && result.data.list) { |
23 | Object.assign(finalResult, { | 23 | Object.assign(finalResult, { |
24 | data: { | 24 | data: { |
25 | list: result.data.list.artList, | 25 | list: result.data.list.artList, |
@@ -28,7 +28,7 @@ const editorialList = params => { | @@ -28,7 +28,7 @@ const editorialList = params => { | ||
28 | code: 200 | 28 | code: 200 |
29 | }); | 29 | }); |
30 | } else { | 30 | } else { |
31 | - logger.error('getEitorialListData api no result.data'); | 31 | + logger.error('getEitorialListData api no data'); |
32 | } | 32 | } |
33 | 33 | ||
34 | return camelCase(finalResult); | 34 | return camelCase(finalResult); |
@@ -13,7 +13,7 @@ const router = expressRouter(); | @@ -13,7 +13,7 @@ const router = expressRouter(); | ||
13 | const editorial = require(`${cRoot}/index`); | 13 | const editorial = require(`${cRoot}/index`); |
14 | 14 | ||
15 | router.get('/list', editorial.index); // 首页 | 15 | router.get('/list', editorial.index); // 首页 |
16 | -router.post('/list.json', editorial.getEditorialList); // 获取资讯数据 | 16 | +router.get('/list.json', editorial.getEditorialList); // 获取资讯数据 |
17 | 17 | ||
18 | // 详情controller | 18 | // 详情controller |
19 | const detail = require(`${cRoot}/detail`); | 19 | const detail = require(`${cRoot}/detail`); |
@@ -85,7 +85,8 @@ | @@ -85,7 +85,8 @@ | ||
85 | contentCode: contentCode.editorial.all, | 85 | contentCode: contentCode.editorial.all, |
86 | editorialList: [], | 86 | editorialList: [], |
87 | page: 0, | 87 | page: 0, |
88 | - scrollDisabled: false | 88 | + scrollDisabled: false, |
89 | + channel: qs.channel | ||
89 | }; | 90 | }; |
90 | }, | 91 | }, |
91 | watch: { | 92 | watch: { |
@@ -97,11 +98,11 @@ | @@ -97,11 +98,11 @@ | ||
97 | 98 | ||
98 | /* 获取资讯列表数据 */ | 99 | /* 获取资讯列表数据 */ |
99 | getNewsList() { | 100 | getNewsList() { |
100 | - $.post({ | 101 | + $.get({ |
101 | url: '/editorial/list.json', | 102 | url: '/editorial/list.json', |
102 | data: { | 103 | data: { |
103 | page: this.page++, | 104 | page: this.page++, |
104 | - channel: qs.channel || 'all' | 105 | + channel: this.channel |
105 | } | 106 | } |
106 | }).done(result => { | 107 | }).done(result => { |
107 | if (result.code === 200) { | 108 | if (result.code === 200) { |
-
Please register or login to post a comment