Showing
1 changed file
with
21 additions
and
19 deletions
@@ -15,7 +15,7 @@ const _processIndexData = (list, type) => { | @@ -15,7 +15,7 @@ const _processIndexData = (list, type) => { | ||
15 | _.forEach(list, (data, index) => { | 15 | _.forEach(list, (data, index) => { |
16 | data.url = `//127.0.0.1:6003/editorial?type=${data.id}`; | 16 | data.url = `//127.0.0.1:6003/editorial?type=${data.id}`; |
17 | 17 | ||
18 | - if (index === parseInt(type)) { | 18 | + if (index === parseInt(type, 0)) { |
19 | data.isActive = true; | 19 | data.isActive = true; |
20 | } else { | 20 | } else { |
21 | data.isActive = false; | 21 | data.isActive = false; |
@@ -24,12 +24,12 @@ const _processIndexData = (list, type) => { | @@ -24,12 +24,12 @@ const _processIndexData = (list, type) => { | ||
24 | formatData.push(data); | 24 | formatData.push(data); |
25 | }); | 25 | }); |
26 | 26 | ||
27 | - if (list.list) { | ||
28 | - _.forEach(list, (data) => { | ||
29 | - publishTime: helpers.dateFormat('MM/DD hh:mm', data.publishTime), | ||
30 | - formatData.push(data); | ||
31 | - }); | ||
32 | - } | 27 | + // if (list.list) { |
28 | + // _.forEach(list, (data) => { | ||
29 | + // publishTime: helpers.dateFormat('MM/DD hh:mm', data.publishTime), | ||
30 | + // formatData.push(data); | ||
31 | + // }); | ||
32 | + // } | ||
33 | 33 | ||
34 | return formatData; | 34 | return formatData; |
35 | }; | 35 | }; |
@@ -45,19 +45,21 @@ const getIndexData = (type) => { | @@ -45,19 +45,21 @@ const getIndexData = (type) => { | ||
45 | }); | 45 | }); |
46 | }; | 46 | }; |
47 | 47 | ||
48 | -const getListData = () => { | ||
49 | - return serviceAPI.get('guang/api/*/article/getList', {}).then((result) => { | ||
50 | - if (result && result.code === 200) { | ||
51 | - return _processIndexData(result.data); | ||
52 | - } else { | ||
53 | - logger.error('资讯列表数据返回 code 不是 200'); | ||
54 | - return {}; | ||
55 | - } | ||
56 | - }); | ||
57 | -}; | 48 | + |
49 | +// const getListData = () => { | ||
50 | +// return serviceAPI.get('guang/api/*/article/getList', {}).then((result) => { | ||
51 | +// if (result && result.code === 200) { | ||
52 | +// return _processIndexData(result.data); | ||
53 | +// } else { | ||
54 | +// logger.error('资讯列表数据返回 code 不是 200'); | ||
55 | +// return {}; | ||
56 | +// } | ||
57 | +// }); | ||
58 | +// }; | ||
58 | 59 | ||
59 | 60 | ||
60 | module.exports = { | 61 | module.exports = { |
61 | - getIndexData, | ||
62 | - getListData | 62 | + getIndexData |
63 | + | ||
64 | + // getListData | ||
63 | }; | 65 | }; |
-
Please register or login to post a comment