mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui-next: layout refactor & dynamic template (#1182)
This commit is contained in:
1 parent
e39a5fa87f
commit
5d5a168572
15 files changed
+114
-55
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user