mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-04 11:13:59 +08:00
feat(file): 新增启用下载(文件名为显示名称), 前端 > 2.14.264
This commit is contained in:
parent
02031019f7
commit
dc320eaa6c
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.14.385",
|
||||
"version": "2.14.386",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -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 ?? '',
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user