mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 支持题目导出
This commit is contained in:
1 parent
a5004a7c1b
commit
ee0f5deedc
11 files changed
+87
-33
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user