fix: 接单池/充值背景按俱乐部下发更稳健,并返回 club_id 便于排查
配置型大图在已上传或路径非默认时均下发;payload 带 club_id,避免后台与小程序俱乐部不一致导致空白。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user