mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-12 21:39:05 +08:00
feat: 下载文件名增加前后缀
This commit is contained in:
parent
f9d120bac3
commit
5058662651
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.16.40",
|
||||
"version": "2.16.41",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -59,7 +59,18 @@ function getCollection(req, res) {
|
||||
res.set('content-type', 'application/json')
|
||||
.set(
|
||||
'content-disposition',
|
||||
`attachment; filename="${encodeURIComponent(name)}.json"`,
|
||||
`attachment; filename="${encodeURIComponent(
|
||||
`sub-store_collection_${name}_${new Date()
|
||||
.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
day: 'numeric',
|
||||
month: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
})
|
||||
.replace(/\D/g, '')}.json`,
|
||||
)}"`,
|
||||
)
|
||||
.send(JSON.stringify(collection));
|
||||
} else {
|
||||
|
@ -209,7 +209,18 @@ function getWholeFile(req, res) {
|
||||
res.set('content-type', 'application/json')
|
||||
.set(
|
||||
'content-disposition',
|
||||
`attachment; filename="${encodeURIComponent(name)}.json"`,
|
||||
`attachment; filename="${encodeURIComponent(
|
||||
`sub-store_file_${name}_${new Date()
|
||||
.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
day: 'numeric',
|
||||
month: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
})
|
||||
.replace(/\D/g, '')}.json`,
|
||||
)}"`,
|
||||
)
|
||||
.send(JSON.stringify(file));
|
||||
} else {
|
||||
|
@ -27,7 +27,18 @@ export default function register($app) {
|
||||
res.set('content-type', 'application/json')
|
||||
.set(
|
||||
'content-disposition',
|
||||
'attachment; filename="sub-store.json"',
|
||||
`attachment; filename="${encodeURIComponent(
|
||||
`sub-store_data_${new Date()
|
||||
.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
day: 'numeric',
|
||||
month: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
})
|
||||
.replace(/\D/g, '')}.json`,
|
||||
)}"`,
|
||||
)
|
||||
.send(
|
||||
$.env.isNode
|
||||
|
@ -264,7 +264,18 @@ function getSubscription(req, res) {
|
||||
res.set('content-type', 'application/json')
|
||||
.set(
|
||||
'content-disposition',
|
||||
`attachment; filename="${encodeURIComponent(name)}.json"`,
|
||||
`attachment; filename="${encodeURIComponent(
|
||||
`sub-store_subscription_${name}_${new Date()
|
||||
.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
day: 'numeric',
|
||||
month: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
})
|
||||
.replace(/\D/g, '')}.json`,
|
||||
)}"`,
|
||||
)
|
||||
.send(JSON.stringify(sub));
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user