fix: 迁移码返回完整URL;确认须在目标店;兼容扫码接收

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-29 03:53:08 +08:00
parent bd1284825c
commit b324e3ee0f
3 changed files with 24 additions and 8 deletions

View File

@@ -980,6 +980,12 @@ def serialize_plan(plan: ClubMigratePlan) -> dict:
def serialize_token(token_row: ClubMigrateToken) -> dict:
qr = (token_row.qrcode_url or '').strip()
if qr and not qr.startswith('http'):
from django.conf import settings
cos_domain = getattr(settings, 'COS_DOMAIN', '').rstrip('/')
if cos_domain:
qr = f'{cos_domain}/{qr.lstrip("/")}'
return {
'token': token_row.token,
'scene': scene_for_token(token_row.token),
@@ -987,7 +993,7 @@ def serialize_token(token_row: ClubMigrateToken) -> dict:
'from_club_id': token_row.from_club_id,
'to_club_id': token_row.to_club_id,
'status': token_row.status,
'qrcode_url': token_row.qrcode_url or '',
'qrcode_url': qr,
'expire_at': token_row.expire_at.isoformat() if token_row.expire_at else '',
'asset_snapshot': token_row.asset_snapshot or {},
}