diff --git a/jituan/services/miniapp_assets.py b/jituan/services/miniapp_assets.py index 345fb0b..ef73496 100644 --- a/jituan/services/miniapp_assets.py +++ b/jituan/services/miniapp_assets.py @@ -195,13 +195,20 @@ def get_miniapp_icons_dict(club_id: str) -> dict: result = {} for key, _label in MINIAPP_ICON_META: row = rows.get(key) - if row and row.is_uploaded and (row.image_path or '').strip(): - result[key] = row.image_path.strip() + path = (row.image_path if row else '') or '' + path = path.strip() + # 已上传:必须下发(含接单池卡背景 / 充值页大图) + if row and path and row.is_uploaded: + result[key] = path continue if key in CONFIG_ONLY_DELIVERY_KEYS: + # 兼容:有非默认路径但 is_uploaded 标志异常时仍下发 + default_path = default_icon_path(key) + if row and path and path != default_path: + result[key] = path continue - if row and (row.image_path or '').strip(): - result[key] = row.image_path.strip() + if row and path: + result[key] = path else: result[key] = default_icon_path(key) return result @@ -250,6 +257,7 @@ def get_poster_payload(club_id: str) -> dict: def build_miniapp_assets_payload(request) -> dict: club_id = _display_club_id(request) return { + 'club_id': club_id, 'icons': get_miniapp_icons_dict(club_id), 'pindao': get_pindao_payload(club_id), 'poster': get_poster_payload(club_id),