|
@@ -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
|