fix(hooks): 解决 streamsaver 访问不到 Github 资源问题

This commit is contained in:
xlsea
2025-07-08 23:05:56 +08:00
parent efc953c094
commit 566b2c2db8
3 changed files with 312 additions and 0 deletions

View File

@ -51,6 +51,7 @@ export function useDownload() {
contentLength?: number
): Promise<void> {
window.$loading?.endLoading();
StreamSaver.mitm = '/streamsaver/mitm.html?version=2.0.0';
const fileStream = StreamSaver.createWriteStream(filename, { size: contentLength });
if (window.WritableStream && readableStream?.pipeTo) {