core: fix renderer UserContext

This commit is contained in:
undefined committed 2022-08-20 21:39:46 +08:00
1 parent 55cee2ef1c
commit 5bc336fc9c
2 files changed
+5 -4

No files matched your search

@@ -13,8 +13,9 @@ const serializer = (showDisplayName = false) => (k: string, v: any) => {
};
export default (router, logger) => async (ctx: KoaContext, next) => {
const { request, response, user } = ctx.HydroContext;
const { request, response } = ctx.HydroContext;
ctx.renderHTML = (templateName, args) => {
const user = ctx.HydroContext.user;
const UserContext: any = {
...(user || {}),
avatar: avatar(user?.avatar || '', 128),