feat: 完成全量功能开发,包括前端管理后台与后端服务优化

此提交实现了完整的知识库管理系统:
1. 新增Vue3 + Antd Vue前端管理后台,包含登录、文档管理、检索、类目设置等完整页面
2. 重构后端LLM调用抽象层,支持Ollama与OpenAI兼容服务动态切换
3. 调整默认嵌入模型配置为本地bge-m3模式
4. 优化入库任务去重逻辑与缓存清理机制
5. 完善Docker镜像构建与docker-compose部署配置
6. 修复多项测试用例与兼容性问题
7. 新增运行时配置API,支持动态调整系统参数
This commit is contained in:
2026-07-31 12:05:25 +08:00
parent fdb664e546
commit 2ab8b56a01
52 changed files with 7030 additions and 171 deletions
+8 -2
View File
@@ -266,9 +266,15 @@ def test_upload_rejects_empty_text_after_parse(
def test_upload_rejects_corrupted_pdf(
client: TestClient, monkeypatch: pytest.MonkeyPatch
) -> None:
"""损坏的 PDFcode=1001message 含'文件解析失败',未提交任务"""
"""损坏的 PDFcode=1001message 含'文件解析失败''无法从文件提取文本',未提交任务
file_parser 插件化后:pypdf 失败被捕获并降级到 OCR;若 OCR 不可用/关闭,
最终返回空文本,由 upload 端点统一报 '无法从文件提取文本'
关闭 OCR 避免触发 rapidocr 模型下载拖慢测试。
"""
manager = FakeManager()
_inject_manager(monkeypatch, manager)
monkeypatch.setattr(document_module.settings, "pdf_ocr_enabled", False)
resp = client.post(
"/api/v1/documents/upload",
@@ -277,7 +283,7 @@ def test_upload_rejects_corrupted_pdf(
body = resp.json()
assert body["code"] == 1001
assert "文件解析失败" in body["message"]
assert "文件解析失败" in body["message"] or "无法从文件提取文本" in body["message"]
assert manager.submitted == []