From b2810ea96e5f9d0ed9a02d205a8c5d37880c560d Mon Sep 17 00:00:00 2001 From: AKW <2497744746@qq.com> Date: Wed, 13 Dec 2023 17:10:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E8=B0=83=E5=9C=B0=E5=9D=80=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - apps/jqr/views.py | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 21485c0..b2bfc31 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ tests/* # C extensions *.so logs/*.log -!logs/test.log # Distribution / packaging .Python build/ diff --git a/apps/jqr/views.py b/apps/jqr/views.py index 527c137..410a23d 100644 --- a/apps/jqr/views.py +++ b/apps/jqr/views.py @@ -9,10 +9,9 @@ from apps.jqr.serializers import WechatPublicTokenSerializer, WechatEncryptSeria class WechatWorkerViewSet(viewsets.GenericViewSet): - @action(methods=['GET'], detail=False, serializer_class=WechatPublicTokenSerializer, url_path='event') - def verify(self, request): - print(self.request._request.path) - print(request.query_params) + @action(methods=['GET'], detail=False, serializer_class=WechatPublicTokenSerializer, url_path=r'event/(?P\w+)',) + def verify(self, request, path, *args, **kwargs): + [business, corpid, agentid, uid] = path.split('_') serializer = self.get_serializer(data=request.query_params) serializer.is_valid(raise_exception=True) enchostr = serializer.data.get('echostr')