diff --git a/app/api/endpoints/message.py b/app/api/endpoints/message.py index 1cf72c33..02de83e9 100644 --- a/app/api/endpoints/message.py +++ b/app/api/endpoints/message.py @@ -165,6 +165,7 @@ def subscribe(subscription: schemas.Subscription, _: schemas.TokenPayload = Depe 客户端webpush通知订阅 """ global_vars.push_subscription(subscription.dict()) + logger.debug(f"通知订阅成功: {subscription.dict()}") return schemas.Response(success=True) diff --git a/app/modules/webpush/__init__.py b/app/modules/webpush/__init__.py index e68c36fa..7785f0fd 100644 --- a/app/modules/webpush/__init__.py +++ b/app/modules/webpush/__init__.py @@ -48,6 +48,7 @@ class WebPushModule(_ModuleBase): content = "" try: for sub in global_vars.get_subscriptions(): + logger.debug(f"给 {sub} 发送WebPush:{caption} {content}") webpush( subscription_info=sub, data=json.dumps({