diff --git a/server/file_association.py b/server/file_association.py index 6c24fe4..b1a9471 100644 --- a/server/file_association.py +++ b/server/file_association.py @@ -338,8 +338,11 @@ def main(): return associations = build_file_associations(word_content, twole_folder, zxxk_folder) - - output_file = base_dir / "file_associations.json" + + # JSON 文件保存到 server 目录下的 jsons 文件夹,文件名与 Word 文档相同 + server_jsons_dir = Path("server") / "jsons" + server_jsons_dir.mkdir(parents=True, exist_ok=True) + output_file = server_jsons_dir / f"{word_doc.stem}.json" with open(output_file, 'w', encoding='utf-8') as f: json.dump(associations, f, ensure_ascii=False, indent=2) print(f"\n✓ 关联关系已保存到:{output_file}")