Commit 48ab252b authored by Xuguangxing's avatar Xuguangxing

feat: 暂时去掉redis缓存,以便测试导航配置

parent fe57d86b
...@@ -8,15 +8,15 @@ export default class ActivityController extends Controller { ...@@ -8,15 +8,15 @@ export default class ActivityController extends Controller {
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo }); body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo });
} else { } else {
const redisKey = `quantum-blocks:page:${ctx.params.id}`; // const redisKey = `quantum-blocks:page:${ctx.params.id}`;
body = await ctx.service.redis.get(redisKey); // body = await ctx.service.redis.get(redisKey);
if (body) { // if (body) {
ctx.logger.info('请求redis成功 key: %j', redisKey); // ctx.logger.info('请求redis成功 key: %j', redisKey);
} // }
if (!body) { // if (!body) {
body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo }); body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo });
await ctx.service.redis.set(redisKey, body); // await ctx.service.redis.set(redisKey, body);
} // }
} }
ctx.body = body; ctx.body = body;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment