diff --git a/js/app.js b/js/app.js index 03f2eb3..f7637f6 100644 --- a/js/app.js +++ b/js/app.js @@ -1758,10 +1758,10 @@ async function handleProcessClick() { // 2. 检查 OCR 配置(如果有 PDF 文件) if (hasPdfFiles) { - let ocrEngine = 'mistral'; + let ocrEngine = 'mineru'; try { if (window.ocrSettingsManager && typeof window.ocrSettingsManager.getCurrentConfig === 'function') { - ocrEngine = window.ocrSettingsManager.getCurrentConfig().engine || 'mistral'; + ocrEngine = window.ocrSettingsManager.getCurrentConfig().engine || 'mineru'; const validation = window.ocrSettingsManager.validateConfig(); if (!validation.valid) { const engineNames = { mistral: 'Mistral OCR', mineru: 'MinerU', doc2x: 'Doc2X', none: '不需要 OCR' }; diff --git a/js/process/main.js b/js/process/main.js index 0a51581..c530a75 100644 --- a/js/process/main.js +++ b/js/process/main.js @@ -137,13 +137,13 @@ const fileType = fileToProcess.name.split('.').pop().toLowerCase(); let usedOcrEngine = null; let usedOcrSource = null; // 更合理的开始日志:显示 OCR 引擎而不是固定显示 Mistral Key - let ocrEngineForLog = 'mistral'; + let ocrEngineForLog = 'mineru'; try { if (typeof window !== 'undefined' && window.ocrSettingsManager && typeof window.ocrSettingsManager.getCurrentConfig === 'function') { const cfg = window.ocrSettingsManager.getCurrentConfig(); if (cfg && cfg.engine) ocrEngineForLog = cfg.engine; } else { - ocrEngineForLog = localStorage.getItem('ocrEngine') || 'mistral'; + ocrEngineForLog = localStorage.getItem('ocrEngine') || 'mineru'; } } catch {} if (typeof addProgressLog === "function") { diff --git a/js/process/ocr-manager.js b/js/process/ocr-manager.js index b7de13f..3467a88 100644 --- a/js/process/ocr-manager.js +++ b/js/process/ocr-manager.js @@ -44,7 +44,7 @@ class OcrManager { } // Fallback: 直接从 localStorage 读取 - const engine = localStorage.getItem('ocrEngine') || 'mistral'; + const engine = localStorage.getItem('ocrEngine') || 'mineru'; switch (engine) { case 'local': diff --git a/js/ui/key-manager-ui.js b/js/ui/key-manager-ui.js index e8b2ef0..289f283 100644 --- a/js/ui/key-manager-ui.js +++ b/js/ui/key-manager-ui.js @@ -711,7 +711,7 @@ KeyManagerUI.exportAllModelData = function() { // 添加 OCR 配置导出 const ocrConfig = { - engine: localStorage.getItem('ocrEngine') || 'mistral', + engine: localStorage.getItem('ocrEngine') || 'mineru', // 默认为 mineru mistralKeys: localStorage.getItem('ocrMistralKeys') || '', workerAuthKey: localStorage.getItem('ocrWorkerAuthKey') || '', mineruToken: localStorage.getItem('ocrMinerUToken') || '', diff --git a/js/ui/ocr-settings.js b/js/ui/ocr-settings.js index d5a1e2a..561194d 100644 --- a/js/ui/ocr-settings.js +++ b/js/ui/ocr-settings.js @@ -106,7 +106,7 @@ class OcrSettingsManager { loadSettings() { try { // 引擎选择 - const engine = localStorage.getItem(this.keys.engine) || 'mistral'; + const engine = localStorage.getItem(this.keys.engine) || 'mineru'; if (this.elements.ocrEngine) { this.elements.ocrEngine.value = engine; this.switchEngine(engine); // 显示对应的配置面板 @@ -476,7 +476,7 @@ class OcrSettingsManager { * @returns {Object} 配置对象 */ getCurrentConfig() { - const engine = localStorage.getItem(this.keys.engine) || 'mistral'; + const engine = localStorage.getItem(this.keys.engine) || 'mineru'; switch (engine) { case 'none': diff --git a/js/ui/ui-processing.js b/js/ui/ui-processing.js index c8cbd6a..96bf23d 100644 --- a/js/ui/ui-processing.js +++ b/js/ui/ui-processing.js @@ -131,18 +131,18 @@ const hasPdfFiles = effectiveFiles.some(file => file.name.toLowerCase().endsWith('.pdf')); // 检查 OCR 引擎与所需配置 - let ocrEngine = 'mistral'; + let ocrEngine = 'mineru'; let ocrConfigValid = true; let ocrConfigMessage = ''; try { if (window.ocrSettingsManager && typeof window.ocrSettingsManager.getCurrentConfig === 'function') { - ocrEngine = window.ocrSettingsManager.getCurrentConfig().engine || (localStorage.getItem('ocrEngine') || 'mistral'); + ocrEngine = window.ocrSettingsManager.getCurrentConfig().engine || (localStorage.getItem('ocrEngine') || 'mineru'); // 使用 validateConfig 检查配置是否完整 const validation = window.ocrSettingsManager.validateConfig(); ocrConfigValid = validation.valid; ocrConfigMessage = validation.message; } else { - ocrEngine = localStorage.getItem('ocrEngine') || 'mistral'; + ocrEngine = localStorage.getItem('ocrEngine') || 'mineru'; } } catch {} diff --git a/js/ui/ui_model_manager_core.js b/js/ui/ui_model_manager_core.js index 9608918..a6b99a6 100644 --- a/js/ui/ui_model_manager_core.js +++ b/js/ui/ui_model_manager_core.js @@ -186,13 +186,13 @@ }); // 检查当前 OCR 引擎配置 - let currentOcrEngine = 'mistral'; + let currentOcrEngine = 'mineru'; let currentOcrConfigured = false; try { if (window.ocrSettingsManager && typeof window.ocrSettingsManager.getCurrentConfig === 'function') { - currentOcrEngine = window.ocrSettingsManager.getCurrentConfig().engine || (localStorage.getItem('ocrEngine') || 'mistral'); + currentOcrEngine = window.ocrSettingsManager.getCurrentConfig().engine || (localStorage.getItem('ocrEngine') || 'mineru'); } else { - currentOcrEngine = localStorage.getItem('ocrEngine') || 'mistral'; + currentOcrEngine = localStorage.getItem('ocrEngine') || 'mineru'; } if (currentOcrEngine === 'none' || currentOcrEngine === 'local') {