Compare commits

...

2 Commits

Author SHA1 Message Date
张 元山
77cd8fddfd Merge branch 'main' of https://gitea-inner.fontree.cn/scout666/fiee-official-website 2025-05-23 15:42:03 +08:00
张 元山
9e2833cdee fix file down 2025-05-23 15:42:02 +08:00

View File

@ -109,7 +109,14 @@ const handleDownload = (url) => {
// a
const link = document.createElement("a");
link.href = url;
link.download = url.split("/").pop(); // URL
//
let fileName = url.split("/").pop();
//
if (fileName.includes("?") || fileName.includes("_t=")) {
fileName = fileName.split(/[?_]/)[0];
}
link.download = fileName;
link.target = "_blank";
//