...
|
...
|
@@ -461,24 +461,23 @@ const _getArticlePre = (id, appType) => { |
|
|
id: id,
|
|
|
app_type: appType
|
|
|
}).then((result) => {
|
|
|
console.log(result.message);
|
|
|
//console.log(result.message);
|
|
|
// result.code = 200;
|
|
|
// result.data = {
|
|
|
// articleIdPre: 34288,
|
|
|
// authorId: 589238
|
|
|
// }
|
|
|
if (result && result.code === 200) {
|
|
|
let perArticle = {};
|
|
|
|
|
|
// let id = result.data.articleIdPre;
|
|
|
return _getHeadData(result.data.articleIdPre, appType).then((list) => {
|
|
|
|
|
|
perArticle.href = `${config.siteUrl}/editorial/${result.data.articleIdPre}.html`;
|
|
|
|
|
|
_getHeadData(result.data.articleIdPre, appType).then((list) => {
|
|
|
console.log(list);
|
|
|
perArticle.lastChapter = list.title;
|
|
|
perArticle.href = `${config.siteUrl}/editorial/${result.data.articleIdPre}.html`;
|
|
|
|
|
|
}).then(() => {
|
|
|
console.log(perArticle);
|
|
|
return perArticle;
|
|
|
});
|
|
|
|
|
|
return perArticle;
|
|
|
} else {
|
|
|
logger.error('In the previous is not 200');
|
|
|
return {};
|
...
|
...
|
@@ -496,22 +495,24 @@ const _getArticleNext = (id, appType) => { |
|
|
id: id,
|
|
|
app_type: appType
|
|
|
}).then((result) => {
|
|
|
console.log(result)
|
|
|
// console.log(result);
|
|
|
|
|
|
// result.code = 200;
|
|
|
// result.data = {
|
|
|
// articleIdNext: 34288,
|
|
|
// authorId: 589238
|
|
|
// }
|
|
|
if (result && result.code === 200) {
|
|
|
|
|
|
let nextArticle = {};
|
|
|
|
|
|
nextArticle.href = `${config.siteUrl}/editorial/${result.data.articleIdNext}.html`;
|
|
|
|
|
|
_getHeadData(result.data.articleIdNext, appType).then((list) => {
|
|
|
return _getHeadData(result.data.articleIdNext, appType).then((list) => {
|
|
|
|
|
|
nextArticle.lastChapter = list.title;
|
|
|
}).then(() => {
|
|
|
nextArticle.href = `${config.siteUrl}/editorial/${result.data.articleIdNext}.html`;
|
|
|
nextArticle.nextChapter = list.title;
|
|
|
|
|
|
return nextArticle;
|
|
|
});
|
|
|
|
|
|
return nextArticle;
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
logger.error('The next article is not 200');
|
...
|
...
|
@@ -644,8 +645,8 @@ const getDetailData = (id, uid, udid, appType) => { |
|
|
content: result[2],
|
|
|
comment: result[3],
|
|
|
brands: result[6],
|
|
|
nextArticle: result[4],
|
|
|
perArticle: result[5]
|
|
|
nextArticle: result[5],
|
|
|
perArticle: result[4]
|
|
|
};
|
|
|
})();
|
|
|
};
|
...
|
...
|
|