fix(admin-web): 修复 TypeScript 类型错误
将 Uint8Array[] 改为 ArrayBuffer[] 以兼容 Blob 构造函数 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
91132ec167
commit
9771a3d69d
|
|
@ -196,14 +196,14 @@ export default function ContractsPage() {
|
|||
}
|
||||
|
||||
const reader = response.body.getReader();
|
||||
const chunks: Uint8Array[] = [];
|
||||
const chunks: ArrayBuffer[] = [];
|
||||
let loaded = 0;
|
||||
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
if (done) break;
|
||||
|
||||
chunks.push(value);
|
||||
chunks.push(value.buffer as ArrayBuffer);
|
||||
loaded += value.length;
|
||||
|
||||
if (total > 0) {
|
||||
|
|
@ -213,7 +213,7 @@ export default function ContractsPage() {
|
|||
}
|
||||
|
||||
// 合并所有 chunks 为 Blob
|
||||
const blob = new Blob(chunks);
|
||||
const blob = new Blob(chunks, { type: 'application/zip' });
|
||||
|
||||
// 写入文件
|
||||
const writable = await fileHandle.createWritable();
|
||||
|
|
|
|||
Loading…
Reference in New Issue