From e1aeb653d656b3c3be05f06cac212f435cec07c3 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期五, 25 七月 2025 15:55:36 +0800 Subject: [PATCH] Merge branch 'dev-3.4.2.5' of http://120.26.58.240:8888/r/12333GovernmentWeb into dev-3.4.2.5 --- 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