ui-next: layout refactor & dynamic template (#1182)

This commit is contained in:
Baoshuo authored and GitHub committed 2026-06-20 17:03:54 +08:00
1 parent e39a5fa87f
commit 5d5a168572
15 files changed
+114 -55

No files matched your search

+1
View File
@@ -84,6 +84,7 @@ export default (logger, xff, xhost) => async (ctx: KoaContext, next: Next) => {
const inject = request.headers['x-hydro-inject'].toString().toLowerCase().split(',').map((i) => i.trim());
if (inject.includes('pagename')) {
ctx.set('x-hydro-page', ctx._matchedRouteName || '');
ctx.set('x-hydro-template', response.template || '');
}
if (response.body !== null && typeof response.body === 'object') {
if (inject.includes('uicontext')) response.body.UiContext = UiContext;