解决老旧浏览器(火狐)流式下载问题V2

This commit is contained in:
xiaocp2009 2025-09-02 14:13:24 +08:00
parent 11bc92ef9c
commit b4a5ee69a4
2 changed files with 5 additions and 4 deletions

View File

@ -120,11 +120,12 @@ export function useDownload() {
const finalFilename = filename || response.headers.get('Download-Filename') || `download-${timestamp}`;
if (response.body) {
/*老旧浏览器还是存在流式传输兼容问题,暂时屏蔽,只使用普通传输*/
/*if (response.body) {
const contentLength = Number(response.headers.get('Content-Length'));
await downloadByStream(response.body, finalFilename, contentLength);
return;
}
}*/
const responseContentType = response.headers.get('Content-Type');
const mainType = responseContentType?.split(';')[0]?.trim() || 'application/octet-stream';

View File

@ -58,11 +58,11 @@ const setDateRange = (type: 'today' | 'week' | 'month') => {
};
//
onMounted(() => {
/*onMounted(() => {
console.log(JSON.stringify(userInfo));
console.log("是否营销:" + userInfo.user.userCategory);
console.log("营销编号:" + userInfo.user.mktNo);
});
});*/
</script>
<template>