mirror of
https://github.com/Cccc-owo/CheckInApp.git
synced 2026-06-17 05:56:29 +00:00
fix: add token refresh situation
This commit is contained in:
+2
-1
@@ -173,7 +173,8 @@ def perform_check_in(config):
|
|||||||
if "打卡成功" in response_text:
|
if "打卡成功" in response_text:
|
||||||
logger.info(f"检测到成功关键字,为 {config['Signature']} 发送成功邮件...")
|
logger.info(f"检测到成功关键字,为 {config['Signature']} 发送成功邮件...")
|
||||||
send_success_notification(config, email_settings)
|
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']} 发送失败提醒邮件...")
|
logger.warning(f"检测到登录失败关键字,为 {config['Signature']} 发送失败提醒邮件...")
|
||||||
send_failure_notification(config, email_settings)
|
send_failure_notification(config, email_settings)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -130,7 +130,7 @@ def send_failure_notification(user_config, email_settings):
|
|||||||
name=user_config["email"],
|
name=user_config["email"],
|
||||||
send_time=time.strftime("%Y年%m月%d日 %H:%M:%S", time.localtime())
|
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():
|
def notification_worker_loop():
|
||||||
"""后台任务:检查Token是否即将过期,并发送邮件提醒。单次运行。"""
|
"""后台任务:检查Token是否即将过期,并发送邮件提醒。单次运行。"""
|
||||||
|
|||||||
Reference in New Issue
Block a user