佛山法律风险
Go to file
Codex Agent fe911592e0 fix: resolve server deployment image 404 errors and enhance admin UI
- Add dedicated image serving API endpoint (/admin/images/<filename>) with security whitelist
- Update image paths from /static/ to /fs-ai-asistant/api/workflow/lawrisk/admin/images/
- Add permit import sample file download endpoint
- Enhance import wizard UI with template/sample preview section
- Add risk count column to unbound permits table
- Filter out "不涉及" (not applicable) theme from theme list
- Improve permit import UX with better visual organization

This ensures images load correctly in server deployments (nginx, gunicorn) by using
the same API prefix as other admin resources, avoiding static file routing issues.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 13:51:20 +08:00
data Backup database 2025-12-25 and clean up project structure 2025-12-25 09:50:02 +08:00
docs feat: 修复V2 API许可证名称匹配和审批部门显示 2025-12-23 16:23:10 +08:00
lawrisk fix: resolve server deployment image 404 errors and enhance admin UI 2026-02-04 13:51:20 +08:00
refer Backup database 2025-12-25 and clean up project structure 2025-12-25 09:50:02 +08:00
static fix: resolve server deployment image 404 errors and enhance admin UI 2026-02-04 13:51:20 +08:00
templates chore: reorganize directory structure and clean up root directory 2025-12-20 11:25:34 +08:00
tests Fix duplicate risk deletion logic and clean up project structure 2025-12-22 11:27:09 +08:00
tools feat(ui,api): resolve department filter errors and enhance import wizard 2026-01-27 14:23:03 +08:00
.gitignore Backup database 2025-12-25 and clean up project structure 2025-12-25 09:50:02 +08:00
CHANGELOG_V2_FIX.md Refactor: Organize project structure by moving scripts to tools and data files to data directory 2025-12-24 09:26:19 +08:00
README.md docs: create root README and update guides with checkpoint system info; fix: JSON serialization bug in checkpoint creation for binary data 2025-12-21 17:26:04 +08:00
app.py Refine import wizard: simplify permit details, add image zoom, and enhance risk metadata display (legal basis, document no, summary) 2026-01-27 15:33:33 +08:00
inspection_output.txt feat(ui,api): resolve department filter errors and enhance import wizard 2026-01-27 14:23:03 +08:00
inspection_output_v2.txt feat(ui,api): resolve department filter errors and enhance import wizard 2026-01-27 14:23:03 +08:00
law_risk.db Backup database 2025-12-25 and clean up project structure 2025-12-25 09:50:02 +08:00
permission_update_stats.md feat(ui,api): resolve department filter errors and enhance import wizard 2026-01-27 14:23:03 +08:00
requirements.txt feat: add authentication system and service department tree structure 2025-11-17 15:07:14 +08:00

README.md

市监局法律风险提示系统 (LawRisk Backend)

智能法律风险检索与管理系统后端服务,基于 Flask 开发,提供行政许可事项的风险提示检索、数据管理及自动化备份功能。

🌟 核心功能

  • 智能检索 (V2 API): 支持自然语言查询,结合向量嵌入和 LLM 技术,精准匹配许可事项与风险点。
  • 行政许可管理: 提供完善的 Excel 导入机制,支持“以新盖旧”模式,并在覆盖前自动创建风险点数据快照。
  • 自动化备份 (Checkpoint): 内置数据库检查点系统,定期或手动记录数据库全量状态,支持一键恢复。
  • 权限管理: 灵活的角色与层级控制,支持市级、区级及具体单位的细粒度数据隔离。
  • 组织架构: 动态组织架构管理,支持拖拽调整层级关系。

🚀 快速开始

1. 环境准备

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt

2. 配置环境变量

修改 .env 文件配置数据库连接、DashScope API 密钥等。详细说明请参考 配置指南

3. 运行服务

python app.py

📖 详细文档

🛠️ 最近更新

  • Checkpoint 系统增强: 修复了二进制数据Excel 原始文件)备份时的 JSON 序列化问题,增强了备份稳定性。
  • 导入机制确认: 支持许可事项的智能覆盖模式,系统在覆盖前会自动执行风险点快照备份。
  • 数据清理: 优化了检查点清理逻辑,支持手动触发全量备份并清空冗余历史记录。

© 2025 市监局项目开发组