fix: 迁移码返回完整URL;确认须在目标店;兼容扫码接收
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -231,12 +231,21 @@ class ClubMigrateConfirmView(APIView):
|
||||
password = str(request.data.get('password') or '').strip()
|
||||
if not token:
|
||||
return Response({'code': 400, 'msg': '缺少令牌'})
|
||||
# 必须在目标店小程序确认(防止源店误点确认)
|
||||
club_id = _resolve_club_id(request)
|
||||
from jituan.models import ClubMigrateToken
|
||||
row = ClubMigrateToken.query.filter(token=token).first()
|
||||
if row and club_id and str(row.to_club_id) != club_id:
|
||||
return Response({
|
||||
'code': 400,
|
||||
'msg': f'请用目标店小程序({row.to_club_id})扫码确认,当前店={club_id}',
|
||||
})
|
||||
data, err = migrate_svc.confirm_migrate(
|
||||
token=token,
|
||||
password=password,
|
||||
to_uid=str(request.user.UserUID),
|
||||
client_meta={
|
||||
'club_id': _user_club(request.user),
|
||||
'club_id': club_id or _user_club(request.user),
|
||||
'ip': request.META.get('REMOTE_ADDR', ''),
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user