Add customizable tabular data exports

This commit is contained in:
biss committed 2026-11-22 21:07:16 +08:00
1 parent 5d5781e707
commit 3e6cd85662
15 files changed
+312 -40

No files matched your search

+2 -1
View File
@@ -31,6 +31,7 @@ export async function downloadApiFile(
path: string,
fallbackName: string,
config?: AxiosRequestConfig,
customName?: string,
) {
const response = await http.get(path, {
...config,
@@ -44,7 +45,7 @@ export async function downloadApiFile(
const url = URL.createObjectURL(response.data)
const anchor = document.createElement('a')
anchor.href = url
anchor.download = responseFileName(
anchor.download = customName || responseFileName(
response.headers['content-disposition'], uniqueFallbackName(path, fallbackName),
)
document.body.appendChild(anchor)