Michael Wang 4 жил өмнө
parent
commit
34b1353e9f
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      src/utils/utils.js

+ 1 - 1
src/utils/utils.js

@@ -56,7 +56,7 @@ function toDataURL(url) {
 export async function downloadFileURL(url, name) {
   const link = document.createElement("a");
   link.style.display = "none";
-  const fileName = name || url.split("/").pop();
+  const fileName = name || url.split("/").pop().split("?")[0];
   link.setAttribute("download", fileName);
 
   // txt 文件会直接在浏览器里面打开,这时候只能修改服务器设置,加上 Content-Disposition: attachment