|
@@ -210,11 +210,11 @@ export default ({
|
|
|
const downloadFile = async () => {
|
|
|
// 文件链接
|
|
|
const fileUrl = 'http://qiniuyun.sunzee.com.cn/log/' + fileName.value;
|
|
|
+ // 文件名
|
|
|
+ const newFileName = fileName.value;
|
|
|
try {
|
|
|
const response = await fetch(fileUrl);
|
|
|
console.log('response', response);
|
|
|
- // 获取文件名
|
|
|
- const fileName = "20231221-1702000724598953359968463.txt";
|
|
|
|
|
|
// 将文件内容创建为Blob
|
|
|
const fileBlob = await response.blob();
|
|
@@ -222,7 +222,7 @@ export default ({
|
|
|
// 创建一个下载链接
|
|
|
const downloadLink = document.createElement('a');
|
|
|
downloadLink.href = URL.createObjectURL(fileBlob);
|
|
|
- downloadLink.download = fileName;
|
|
|
+ downloadLink.download = newFileName;
|
|
|
|
|
|
// 模拟点击下载链接
|
|
|
document.body.appendChild(downloadLink);
|