From 7bb0b1a463d97f3b7dba7e70c54a91d2e87e1d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Thu, 7 Apr 2022 19:54:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/file.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/file.ts b/src/utils/file.ts index 0f8a15f2..0ce0978f 100644 --- a/src/utils/file.ts +++ b/src/utils/file.ts @@ -24,7 +24,7 @@ export const readFile = (file: File) => { * @param filename * @param fileSuffix */ -export const downloadByA = (url: string, filename = new Date().getDate().toString(), fileSuffix?: string) => { +export const downloadByA = (url: string, filename = new Date().getTime(), fileSuffix?: string) => { const ele = document.createElement('a') // 创建下载链接 ele.download = `${filename}.${fileSuffix}` //设置下载的名称 ele.style.display = 'none' // 隐藏的可下载链接 @@ -45,7 +45,7 @@ export const downloadByA = (url: string, filename = new Date().getDate().toStrin */ export const downloadTextFile = ( content: string, - filename = new Date().getDate().toString(), + filename = new Date().getTime(), fileSuffix?: string ) => { // 字符内容转变成blob地址