Revert "fix: geektime description is [Object object] " (#2603)

This reverts commit 6d1b4870e5.
This commit is contained in:
DIYgod
2019-07-11 14:48:32 +08:00
committed by GitHub
parent 6d1b4870e5
commit 12663e71e6
2 changed files with 4 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ module.exports = async (ctx) => {
if (item.id !== undefined) {
const value = ctx.cache.get(item.id);
if (value) {
single.description = JSON.parse(value);
single.description = value;
} else {
try {
const article_response = await got({
@@ -67,7 +67,7 @@ module.exports = async (ctx) => {
});
single.description = article_response.data.data.article_content;
ctx.cache.set(item.id, JSON.stringify(single.description));
ctx.cache.set(item.id, single.description);
} catch (err) {
single.description = description;
}

View File

@@ -50,7 +50,7 @@ module.exports = async (ctx) => {
if (item.id !== undefined) {
const value = ctx.cache.get(item.id);
if (value) {
single.description = JSON.parse(value);
single.description = value;
} else {
try {
const article_response = await got({
@@ -67,7 +67,7 @@ module.exports = async (ctx) => {
});
single.description = article_response.data.data.article_content;
ctx.cache.set(item.id, JSON.stringify(single.description));
ctx.cache.set(item.id, single.description);
} catch (err) {
single.description = description;
}