From 3381386b888c597da4835c9ed98ee9880ad00e96 Mon Sep 17 00:00:00 2001 From: zw <12345678> Date: Thu, 4 Sep 2025 20:50:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/iOSAI.iml | 2 +- .idea/misc.xml | 2 +- Module/FlaskService.py | 3 +-- Utils/LogManager.py | 14 -------------- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.idea/iOSAI.iml b/.idea/iOSAI.iml index df5cbff..f571432 100644 --- a/.idea/iOSAI.iml +++ b/.idea/iOSAI.iml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index c27b771..db8786c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/Module/FlaskService.py b/Module/FlaskService.py index d267a95..9a56cca 100644 --- a/Module/FlaskService.py +++ b/Module/FlaskService.py @@ -312,14 +312,13 @@ def monitorMessages(): @app.route("/setLoginInfo", methods=['POST']) -def upLoadLogFile(): +def upLoadLogLogs(): data = request.get_json() # 解析 JSON token = data.get("token") userId = data.get("userId") tenantId = data.get("tenantId") ok = LogManager.upload_all_logs("http://47.79.98.113:8101/api/log/upload", token, userId, tenantId) if ok: - print(123) return ResultData(data="日志上传成功").toJson() else: return ResultData(data="", msg="日志上传失败").toJson() diff --git a/Utils/LogManager.py b/Utils/LogManager.py index 7233acd..2cb0178 100644 --- a/Utils/LogManager.py +++ b/Utils/LogManager.py @@ -235,7 +235,6 @@ class LogManager: @classmethod def clearLogs(cls): """启动时清空 log 目录下所有文件""" - print("开始清空日志...") # 关闭所有 handler for name, logger in logging.Logger.manager.loggerDict.items(): @@ -258,13 +257,11 @@ class LogManager: # 清缓存 cls._method_loggers.clear() - print("日志清空完成") @classmethod def upload_all_logs(cls, server_url, token, userId, tenantId): log_path = Path(cls.logDir) if not log_path.exists(): - print("[upload_all_logs] 日志目录不存在") return False timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") @@ -286,20 +283,9 @@ class LogManager: files = { "file": (filename, io.BytesIO(zip_bytes), "application/zip") } - print( - f"[upload_all_logs] " - f"server={server_url} (type={type(server_url)}) " - f"tenantId={tenantId} (type={type(tenantId)}) " - f"userId={userId} (type={type(userId)}) " - f"token={token} (type={type(token)})" - ) - print("开始上传") # 3) 上传 resp = requests.post(server_url, headers=headers, data=data, files=files) - print(resp.text) - print("上传结束") - if resp.json()['data']: return True return False