From 5eb095228e54e33b733aa485bdc96c3d2a6ca07f Mon Sep 17 00:00:00 2001 From: jshixiong <2645476194@qq.com> Date: Wed, 14 May 2025 11:42:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/login_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/login_info.py b/app/login_info.py index ac176c8..0cc768d 100644 --- a/app/login_info.py +++ b/app/login_info.py @@ -23,7 +23,7 @@ def get_recent_login_info(page_index=1, page_size=10): data = response.json() response.raise_for_status() # 如果响应状态码不是 200,会引发 HTTPError logging.debug(f"请求{url} 返回参数: {data}") - except requests.exceptions.RequestException as e: + except Exception as e: # 处理可能的请求错误 logging.info(f"recent_login_info请求发生错误: {e}") @@ -44,7 +44,7 @@ def get_online_size(): logging.debug(f"请求{url} 返回参数: {data}") return data.get('data', {}).get('online_num', 0) - except requests.exceptions.RequestException as e: + except Exception as e: # 处理可能的请求错误 logging.info(f"online_size请求发生错误: {e}") return 0 \ No newline at end of file