fix(data): 自动归集空汇总不写0 + Excel导入示例文件防线 (DAMA审计20260906代码类)

This commit is contained in:
Hermes CI Fix
2026-09-06 16:57:03 +08:00
parent 594bb00a38
commit d71c7fef67
2 changed files with 18 additions and 1 deletions
+2
View File
@@ -945,6 +945,8 @@ async def api_import_vouchers(
content = await file.read()
fname = (file.filename or "网银流水.xlsx").strip()
if any(kw in fname.lower() for kw in ("示例", "sample", "test", "demo", "测试")):
raise HTTPException(400, f"文件名含测试标识,拒绝导入生产库: {fname}")
try:
df = pd.read_excel(io.BytesIO(content))
except Exception as e: