Authored by 郝肖肖

'code'

... ... @@ -24,9 +24,11 @@ class XzhIndexModel extends global.yoho.BaseModel {
return util.sleep(3000).then(() => {
return this.getLastArticleList({page: 1, limit: 1000});
}).then(rdata => {
let code = rdata.code || 400;
rdata = _.get(rdata, 'data.artList', []);
if (rdata.length <= 0) {
if (code === 200 && rdata.length <= 0) {
return false;
}
... ... @@ -39,6 +41,11 @@ class XzhIndexModel extends global.yoho.BaseModel {
// 向百度发送数据
sendData(data, type) {
if (data.length <= 0) {
return Promise.resolve({code: 400, data:{}, message: 'data is empty'});
}
type = type || 'batch';
data = _.map(data, item => {
... ...