diff --git a/app/lib/core/network/api_client.dart b/app/lib/core/network/api_client.dart index 95725dc..e272e57 100644 --- a/app/lib/core/network/api_client.dart +++ b/app/lib/core/network/api_client.dart @@ -85,7 +85,7 @@ class ApiClient { ); } - static const _kBasePref = 'xl_api_base_v3'; // v3:旧地址记忆不迁移 + static const _kBasePref = 'xl_api_base_v4'; // v3:旧地址记忆不迁移 final TokenStore _tokens; late final Dio _dio; diff --git a/app/lib/main.dart b/app/lib/main.dart index 087fd80..7af6398 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -13,6 +13,7 @@ import 'core/storage/token_store.dart'; import 'core/theme/app_theme.dart'; import 'features/auth/auth_controller.dart' show authStageProvider; import 'features/home/home_page.dart'; +import 'core/widgets/debug_overlay.dart' show DebugOverlay; import 'features/misc/system_pages.dart'; import 'features/settings/settings_page.dart'; @@ -86,6 +87,10 @@ class _XuanlongAppState extends ConsumerState { theme: buildXlTheme(), routerConfig: router, debugShowCheckedModeBanner: false, + // 测试版:--dart-define=DEBUG_OVERLAY=true 打开日志悬浮窗 + builder: (context, child) => const bool.fromEnvironment('DEBUG_OVERLAY') + ? DebugOverlay(child: child ?? const SizedBox.shrink()) + : (child ?? const SizedBox.shrink()), ); } } diff --git a/server/app/services/dispatch.py b/server/app/services/dispatch.py index 63df182..3e17a85 100644 --- a/server/app/services/dispatch.py +++ b/server/app/services/dispatch.py @@ -27,17 +27,21 @@ def _in_dnd(user: dict, now: datetime) -> bool: def _targets(conn) -> list[dict]: - """已激活 + 未封禁 + 推送开 + 非免打扰 的设备列表。""" + """已激活 + 未封禁 + 推送开 + 非免打扰 的用户列表。 + + 注意:App 内通知列表面向所有激活用户,不依赖 JPush 设备注册—— + RID 为空只影响 push_pending 能否推送,不影响通知行生成。 + (原实现 JOIN devices 且要求 jpush_rid 非空,导致未接 JPush 时 + 所有用户的通知列表永远为空。)""" now = _now() now_s = now.strftime("%Y-%m-%d %H:%M:%S") rows = conn.execute( """ - SELECT u.id AS user_id, d.id AS device_id, d.jpush_rid, + SELECT u.id AS user_id, COALESCE(s.push_enabled,1) AS push_enabled, COALESCE(s.dnd_enabled,0) AS dnd_enabled, s.dnd_start, s.dnd_end FROM users u - JOIN devices d ON d.user_id = u.id AND d.rid_invalid = 0 AND d.jpush_rid IS NOT NULL LEFT JOIN user_settings s ON s.user_id = u.id WHERE u.is_banned = 0 AND u.active_until >= ? """,