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

fix: 渲染方式调整

parent 6a40b723
......@@ -6,7 +6,7 @@ export default class ActivityController extends Controller {
const apollo = ctx.app.config.apollo || {};
let body = '';
if (process.env.NODE_ENV === 'development') {
body = await ctx.renderView('activity.js', { url: ctx.url, apollo });
body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo });
} else {
const redisKey = `quantum-blocks:page:${ctx.params.id}`;
body = await ctx.service.redis.get(redisKey);
......@@ -14,7 +14,7 @@ export default class ActivityController extends Controller {
ctx.logger.info('请求redis成功 key: %j', redisKey);
}
if (!body) {
body = await ctx.renderView('activity.js', { url: ctx.url, apollo });
body = await ctx.renderToHtml('activity.js', { url: ctx.url, apollo });
await ctx.service.redis.set(redisKey, 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