mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix renderer UserContext
This commit is contained in:
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),
|
||||
|
||||
Reference in new issue
Block a user