From cae4a61c60e597e67d29ef459b9eb2cd243dc18e Mon Sep 17 00:00:00 2001 From: Shuming Liu Date: Thu, 2 Apr 2026 10:46:13 +0800 Subject: [PATCH] modified jsonfile save mode --- server/file_association.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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}")