async function downloadFile(url, filename) {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error('网络响应失败');
}
const blob = await response.blob();
const blobUrl = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = blobUrl;
link.download = filename;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(blobUrl);
} catch (error) {
// console.error('下载文件失败:', error);
}
}
const fileUrl = downloadUrl.value;
const newFileName = '快成单.apk';
downloadFile(fileUrl, newFileName);