From 12663e71e6b80f084d8a80ed7ecb6818b5e36172 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 11 Jul 2019 14:48:32 +0800 Subject: [PATCH] Revert "fix: geektime description is [Object object] " (#2603) This reverts commit 6d1b4870e59a312049a58658abe78c37b770e17b. --- lib/routes/geektime/column.js | 4 ++-- lib/routes/geektime/news.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/routes/geektime/column.js b/lib/routes/geektime/column.js index 92edfd22e..c99ca2d46 100644 --- a/lib/routes/geektime/column.js +++ b/lib/routes/geektime/column.js @@ -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; } diff --git a/lib/routes/geektime/news.js b/lib/routes/geektime/news.js index 7f51d303e..7e577f391 100644 --- a/lib/routes/geektime/news.js +++ b/lib/routes/geektime/news.js @@ -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; }