mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
feat(file): 新增启用下载(文件名为显示名称), 前端 > 2.14.264
This commit is contained in:
@@ -141,7 +141,14 @@ async function getFile(req, res) {
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (file.download) {
|
||||
res.set(
|
||||
'Content-Disposition',
|
||||
`attachment; filename*=UTF-8''${encodeURIComponent(
|
||||
file.displayName || file.name,
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
res.set('Content-Type', 'text/plain; charset=utf-8').send(
|
||||
output ?? '',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user