core: 支持题目导出

This commit is contained in:
undefined committed 2020-11-07 23:47:35 +08:00
1 parent a5004a7c1b
commit ee0f5deedc
11 files changed
+87 -33

No files matched your search

+6 -3
View File
@@ -357,11 +357,14 @@ export class Handler {
status: null,
template: null,
redirect: null,
attachment: (name, stream) => {
attachment: (name, streamOrBuffer) => {
ctx.attachment(name);
if (stream) {
if (streamOrBuffer instanceof Buffer) {
this.response.body = null;
ctx.body = stream.pipe(new PassThrough());
ctx.body = streamOrBuffer;
} else {
this.response.body = null;
ctx.body = streamOrBuffer.pipe(new PassThrough());
}
},
disposition: null,