Files
order_site/apps
yml bc5fd4212d feat(backend): refactor OCR client to support HTTP + subprocess dual mode
- runtime-config.js: add baseUrl field to ocr type definition
- default.cjs: add ocr.baseUrl default (empty string = subprocess mode)
- runtime.js: add OCR_BASE_URL env var parsing
- ocr.js: add HTTP mode (when OCR_BASE_URL set) alongside existing subprocess mode
  - resolveOcrMode() detects mode from runtimeConfig.ocr.baseUrl
  - callOcrViaHttp() calls FastAPI endpoints directly with payload
  - warmupOcrViaHttp() calls /health endpoint for HTTP mode warmup
  - callOcrRequest() routes between HTTP and subprocess based on mode
  - All 5 original exports preserved (recognizeTencentCaptcha, etc.)
  - Subprocess mode remains backward compatible (default when no OCR_BASE_URL)
2026-05-19 23:09:30 +08:00
..