From 55da2e2e67d53e665880b6b6ad6e9df55586f6e5 Mon Sep 17 00:00:00 2001 From: Wxw-Gu Date: Wed, 5 Aug 2026 10:21:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=AD=E9=9F=B3=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/voice-pipeline/model-manager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/voice-pipeline/model-manager.ts b/src/main/voice-pipeline/model-manager.ts index e665e18..e2dcd61 100644 --- a/src/main/voice-pipeline/model-manager.ts +++ b/src/main/voice-pipeline/model-manager.ts @@ -1,4 +1,5 @@ import { createHash } from 'crypto' +import { net } from 'electron' import { createReadStream } from 'fs' import { mkdir, open, readFile, rename, rm, stat, writeFile } from 'fs/promises' import { join } from 'path' @@ -163,7 +164,10 @@ export class VoiceModelManager { const target = join(this.modelRoot, file.name) const partial = `${target}.partial` await rm(partial, { force: true }) - const response = await fetch(file.url, { signal }) + // Use Chromium's network stack rather than Node's global fetch so model + // downloads follow the operating system proxy configuration. This matters + // on networks where Hugging Face is only reachable through a system proxy. + const response = await net.fetch(file.url, { signal }) if (!response.ok || !response.body) throw new Error(`模型下载失败:HTTP ${response.status}`) const handle = await open(partial, 'w')