fix: add token refresh situation

This commit is contained in:
2025-12-12 19:50:31 +08:00
parent 8fa0bdd1a1
commit 3d201bc497
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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)
+1 -1
View File
@@ -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是否即将过期,并发送邮件提醒。单次运行。"""