mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: support response.pjax
This commit is contained in:
1 parent
89fb04bfb3
commit
f08ac664da
6 files changed
+27
-48
No files matched your search
@@ -35,6 +35,9 @@ export default (logger) => async (ctx: KoaContext, next) => {
|
||||
response.body = new SystemError('Serialize failure', e.message);
|
||||
}
|
||||
response.type = 'application/json';
|
||||
} else if (response.pjax && args.pjax) {
|
||||
const html = await ctx.renderHTML(response.pjax, response.body);
|
||||
response.body = { fragments: [{ html }] };
|
||||
} else if (response.template) {
|
||||
const s = response.template.split('.');
|
||||
let templateName = `${s[0]}.${args.domainId}.${s[1]}`;
|
||||
|
||||
Reference in new issue
Block a user