fix: geektime description is [Object object] (#2601)

* fix: geektime description is [Object object]

* fix: geektime description is [Object object]
This commit is contained in:
Cloud
2019-07-11 14:17:58 +08:00
committed by DIYgod
parent c603343aff
commit 6d1b4870e5
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 = value;
single.description = JSON.parse(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, single.description);
ctx.cache.set(item.id, JSON.stringify(single.description));
} catch (err) {
single.description = description;
}