修复底层配置服务混乱的问题

This commit is contained in:
cc
2026-04-29 23:59:56 +08:00
parent 7469337aeb
commit 1fc710ccef
10 changed files with 131 additions and 196 deletions

View File

@@ -1,9 +1,9 @@
import { app } from 'electron'
import { existsSync, mkdirSync, statSync, unlinkSync, createWriteStream, openSync, writeSync, closeSync } from 'fs'
import { join } from 'path'
import * as https from 'https'
import * as http from 'http'
import { ConfigService } from './config'
import { getPathFallback } from './electronRuntime'
// Sherpa-onnx 类型定义
type OfflineRecognizer = any
@@ -91,7 +91,7 @@ export class VoiceTranscribeService {
private resolveModelDir(): string {
const configured = this.configService.get('whisperModelDir') as string | undefined
if (configured) return configured
return join(getPathFallback('documents'), 'WeFlow', 'models', 'sensevoice')
return join(app.getPath('documents'), 'WeFlow', 'models', 'sensevoice')
}
private resolveModelPath(fileName: string): string {