更新新增三个模块

This commit is contained in:
super
2026-03-22 11:20:09 +08:00
parent 74a5fb9ce1
commit 8e66926b9e
112 changed files with 5411 additions and 606 deletions

View File

@@ -145,7 +145,7 @@ class WindowAPI:
)
return result[0] if result else ''
def upload_file_to_java(self, file_path):
def upload_file_to_java(self, file_path, relative_path=None):
"""按本地路径读取文件并上传到 Java 后端临时目录。"""
if not file_path or not str(file_path).strip():
return {'success': False, 'error': '文件路径为空'}
@@ -157,6 +157,7 @@ class WindowAPI:
response = requests.post(
f"{JAVA_API_BASE}/api/files/upload",
files={'file': (os.path.basename(normalized_path), file_obj)},
data={'relativePath': str(relative_path).strip()} if relative_path else None,
timeout=120,
)
response.raise_for_status()