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