From 0f7e5c503c16ce7b665eb8cefc90f761e41ea4a7 Mon Sep 17 00:00:00 2001 From: XingQue Date: Sat, 25 Jul 2026 20:56:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20icon=5Fkey=20=E6=97=A0=E6=95=88=E6=97=B6?= =?UTF-8?q?=E5=9B=9E=E4=BC=A0=E5=85=B7=E4=BD=93=20key=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=9C=80=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8D=95?= =?UTF-8?q?=E6=B1=A0=E8=83=8C=E6=99=AF=E7=9B=B8=E5=85=B3=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 便于定位是空 key 还是服务器未 pull/未重启导致 grab_card_* 未注册。 Co-authored-by: Cursor --- jituan/views_miniapp_assets.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/jituan/views_miniapp_assets.py b/jituan/views_miniapp_assets.py index 1f8ee9a..c14b71b 100644 --- a/jituan/views_miniapp_assets.py +++ b/jituan/views_miniapp_assets.py @@ -98,9 +98,20 @@ class ClubMiniappIconManageView(APIView): action = (request.data.get('action') or 'upload').strip() club_id = resolve_effective_club_id(request, request.user) - icon_key = (request.data.get('icon_key') or '').strip() + raw_key = request.data.get('icon_key') + if raw_key is None or raw_key == '': + raw_key = request.query_params.get('icon_key') + if isinstance(raw_key, (list, tuple)): + raw_key = raw_key[0] if raw_key else '' + icon_key = str(raw_key or '').strip() if icon_key not in MINIAPP_ICON_LABELS: - return Response({'code': 400, 'msg': 'icon_key 无效'}) + return Response({ + 'code': 400, + 'msg': ( + f'icon_key 无效: {icon_key or "(空)"}。' + '若上传接单池卡背景,请确认 Django 已 pull 到含 grab_card_* 的提交并重启进程' + ), + }) if action == 'save_meta': description = (request.data.get('description') or '').strip()