Commit 0aa55b47 authored by 郭志伟's avatar 郭志伟

fix(activity): 还原

parent 96b55162
...@@ -2,11 +2,6 @@ import { Controller, Context } from 'egg'; ...@@ -2,11 +2,6 @@ import { Controller, Context } from 'egg';
export default class ActivityController extends Controller { export default class ActivityController extends Controller {
public async home(ctx: Context) { public async home(ctx: Context) {
// 开发环境不走redis缓存
if (process.env.NODE_ENV === 'development') {
ctx.body = await ctx.renderView('activity.js', { url: ctx.url });
return;
}
const redisKey = `quantum-blocks:page:${ctx.params.id}`; const redisKey = `quantum-blocks:page:${ctx.params.id}`;
let body = await ctx.service.redis.get(redisKey); let body = await ctx.service.redis.get(redisKey);
if (body) { if (body) {
...@@ -21,5 +16,6 @@ export default class ActivityController extends Controller { ...@@ -21,5 +16,6 @@ export default class ActivityController extends Controller {
await ctx.service.redis.set(redisKey, body); await ctx.service.redis.set(redisKey, body);
} }
ctx.body = body; ctx.body = body;
// ctx.body = await ctx.renderView('activity.js', { url: ctx.url });
} }
} }
\ No newline at end of file
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