From 7f268bea057e788824bdf290275342d0980cbaeb Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期二, 15 四月 2025 14:43:47 +0800 Subject: [PATCH] fix: bug --- src/utils/common/download.ts | 15 +++------------ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/utils/common/download.ts b/src/utils/common/download.ts index e9bf8f1..961ea6c 100644 --- a/src/utils/common/download.ts +++ b/src/utils/common/download.ts @@ -1,5 +1,5 @@ import { format } from '@/utils'; -import { BoleRegExp, FILEMIME } from '@bole-core/core'; +import { BoleRegExp, FILEMIME, downloadFileByUrl as _downloadFileByUrl } from '@bole-core/core'; import { saveAs } from 'file-saver'; import JSZip from 'jszip'; @@ -29,18 +29,9 @@ } } -export function downloadFileByUrl(fileUrl, fileName?: string) { - //const suffix = /\.([0-9a-z]+)(?:[\?#]|$)/i.exec(fileUrl)[1]; - const suffix = /\.([0-9a-z]+)(?:[#]|$)/i.exec(fileUrl)[1]; - let name = fileName ? fileName : fileUrl.replace(BoleRegExp.RegFileName, '$2'); - name += `.${suffix}`; - saveAs(fileUrl, name); +export function downloadFileByUrl(fileUrl: string, fileName?: string) { + _downloadFileByUrl(fileUrl, fileName); return; - // if (/pdf/gi.test(suffix)) { - // handlePdfLink(fileUrl, name); - // } else { - // handleFileDownload(fileUrl, name); - // } } export const handleFileSaver = (file, name) => { saveAs(file, name); -- Gitblit v1.9.1