fix: 公告轮播page_key逻辑与商家充值轮询yonghuid字段
This commit is contained in:
@@ -70,14 +70,19 @@ def allowed_lunbo_page_keys_for_user(user):
|
||||
|
||||
def resolve_lunbo_page_key_for_request(request, page_key=None, image_type=1):
|
||||
"""
|
||||
按身份限制 page_key:
|
||||
- 无特殊身份:仅 order_pool / accept_order
|
||||
- 商家:+ merchant_home
|
||||
- 打手:+ dashou_center
|
||||
无权访问所请求的 page_key 时返回 None(接口应返回空公告/轮播)。
|
||||
按身份限制 page_key(与小程序 display-config.js 对齐):
|
||||
- order_pool / accept_order:任何人(含未登录)均可访问
|
||||
- merchant_home / dashou_center:未登录时按前端传入的 page_key 返回(接口 AllowAny、前端不传 JWT)
|
||||
- 已登录时:无对应扩展表身份则拒绝该 page_key(返回 None)
|
||||
"""
|
||||
requested = normalize_page_key(page_key, image_type=image_type)
|
||||
if requested in PUBLIC_LUNBO_PAGE_KEYS:
|
||||
return requested
|
||||
|
||||
user = getattr(request, 'user', None)
|
||||
if not user or not getattr(user, 'is_authenticated', False):
|
||||
return requested
|
||||
|
||||
allowed = allowed_lunbo_page_keys_for_user(user)
|
||||
if requested in allowed:
|
||||
return requested
|
||||
|
||||
Reference in New Issue
Block a user