Authored by 郝肖肖

'catch'

@@ -22,7 +22,7 @@ class XzhIndexModel extends global.yoho.BaseModel { @@ -22,7 +22,7 @@ class XzhIndexModel extends global.yoho.BaseModel {
22 22
23 sendDataHistory(page) { 23 sendDataHistory(page) {
24 return util.sleep(3000).then(() => { 24 return util.sleep(3000).then(() => {
25 - return this.getLastArticleList({page: 1}); 25 + return this.getLastArticleList({page: 1, limit: 1000});
26 }).then(rdata => { 26 }).then(rdata => {
27 rdata = _.get(rdata, 'data.artList', []); 27 rdata = _.get(rdata, 'data.artList', []);
28 28
@@ -52,6 +52,9 @@ class XzhIndexModel extends global.yoho.BaseModel { @@ -52,6 +52,9 @@ class XzhIndexModel extends global.yoho.BaseModel {
52 timeout: 8 * 1000 52 timeout: 8 * 1000
53 }).then(result => { 53 }).then(result => {
54 return JSON.parse(result || '{}'); 54 return JSON.parse(result || '{}');
  55 + }).catch(e => {
  56 + console.log(e.message);
  57 + return {code: 400, data: {}, message: e.message};
55 }); 58 });
56 } 59 }
57 60
@@ -64,9 +67,6 @@ class XzhIndexModel extends global.yoho.BaseModel { @@ -64,9 +67,6 @@ class XzhIndexModel extends global.yoho.BaseModel {
64 return this.get({ 67 return this.get({
65 url: '/guang/api/v2/article/getLastArticleList', 68 url: '/guang/api/v2/article/getLastArticleList',
66 data: params, 69 data: params,
67 - param: {  
68 - cache: 86400  
69 - },  
70 api: global.yoho.ServiceAPI 70 api: global.yoho.ServiceAPI
71 }).catch(e => { 71 }).catch(e => {
72 console.log(e.message); 72 console.log(e.message);