mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 23:00:48 +08:00
fix cache type
This commit is contained in:
@@ -40,7 +40,7 @@ module.exports = function(app, options = {}) {
|
||||
if (value) {
|
||||
await redisClient.expire(key, 24 * 60 * 60);
|
||||
}
|
||||
return value;
|
||||
return value + '';
|
||||
}
|
||||
},
|
||||
set: async function(key, value, maxAge = 24 * 60 * 60) {
|
||||
@@ -81,7 +81,7 @@ module.exports = function(app, options = {}) {
|
||||
app.context.cache = {
|
||||
get: (key) => {
|
||||
if (key) {
|
||||
return routeCache.get(key);
|
||||
return routeCache.get(key) + '';
|
||||
}
|
||||
},
|
||||
set: (key, value, maxAge = 24 * 60 * 60) => {
|
||||
|
||||
@@ -5,12 +5,12 @@ module.exports = async (ctx, next) => {
|
||||
|
||||
// decode HTML entities
|
||||
if (ctx.state.data) {
|
||||
ctx.state.data.title && (ctx.state.data.title = he.decode(ctx.state.data.title));
|
||||
ctx.state.data.description && (ctx.state.data.description = he.decode(ctx.state.data.description));
|
||||
ctx.state.data.title && (ctx.state.data.title = he.decode(ctx.state.data.title + ''));
|
||||
ctx.state.data.description && (ctx.state.data.description = he.decode(ctx.state.data.description + ''));
|
||||
ctx.state.data.item &&
|
||||
ctx.state.data.item.forEach((item) => {
|
||||
item.title && (item.title = he.decode(item.title));
|
||||
item.description && (item.description = he.decode(item.description));
|
||||
item.title && (item.title = he.decode(item.title + ''));
|
||||
item.description && (item.description = he.decode(item.description + ''));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user