ai 开始测试

This commit is contained in:
2025-09-03 19:03:34 +08:00
parent 8317470fb5
commit b555712749
7 changed files with 251 additions and 64 deletions

View File

@@ -91,6 +91,8 @@ from pathlib import Path
import requests
from Entity.Variables import token
class LogManager:
# 运行根目录:打包后取 exe 目录;源码运行取项目目录
@@ -271,12 +273,25 @@ class LogManager:
for file in log_path.rglob("*.log"): # 递归找到所有 .log 文件
try:
files = {"file": open(file, "rb")}
data = {"relative_path": str(file.relative_to(log_path))}
headers = {
"Authorization": f"Bearer {token}",
}
data = {
# "relative_path": str(file.relative_to(log_path))
"tenantId": 1,
"userId": 1,
}
if extra_data:
data.update(extra_data)
resp = requests.post(server_url, files=files, data=data, headers=headers ,timeout=15)
print(resp.text)
print(resp.status_code)
resp = requests.post(server_url, files=files, data=data, timeout=15)
if resp.status_code == 200:
success_files.append(file.name)
else: