From 3d201bc4977698ff490748db6f47c5dbd312ae9e Mon Sep 17 00:00:00 2001 From: Cccc_ Date: Fri, 12 Dec 2025 19:50:31 +0800 Subject: [PATCH] fix: add token refresh situation --- check_in_worker.py | 3 ++- email_notifier.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/check_in_worker.py b/check_in_worker.py index cb40eb5..bb943f8 100644 --- a/check_in_worker.py +++ b/check_in_worker.py @@ -173,7 +173,8 @@ def perform_check_in(config): if "打卡成功" in response_text: logger.info(f"检测到成功关键字,为 {config['Signature']} 发送成功邮件...") send_success_notification(config, email_settings) - elif "QSfqFrHF0jbMZcd3DVuvf6k5HceMjOlDwzX1b/SJ4agLnRkO" in response_text: # 打卡失败附带的Data + elif ("QSfqFrHF0jbMZcd3DVuvf6k5HceMjOlDwzX1b/SJ4agLnRkO" in response_text or + "请先授权登录小程序" in response_text): # 打卡失败附带的Data 或 授权失效 logger.warning(f"检测到登录失败关键字,为 {config['Signature']} 发送失败提醒邮件...") send_failure_notification(config, email_settings) diff --git a/email_notifier.py b/email_notifier.py index d783cd0..d30d247 100644 --- a/email_notifier.py +++ b/email_notifier.py @@ -130,7 +130,7 @@ def send_failure_notification(user_config, email_settings): name=user_config["email"], send_time=time.strftime("%Y年%m月%d日 %H:%M:%S", time.localtime()) ) - _send_email(user_config["email"], "【紧急】自动打卡失败 - 需要刷新Token", html, email_settings) + _send_email(user_config["email"], "打卡失败 - 需要刷新Token", html, email_settings) def notification_worker_loop(): """后台任务:检查Token是否即将过期,并发送邮件提醒。单次运行。"""