回调地址路由调整

This commit is contained in:
AKW 2023-12-13 17:10:26 +08:00
parent 877dbad7fc
commit b2810ea96e
2 changed files with 3 additions and 5 deletions

1
.gitignore vendored
View File

@ -16,7 +16,6 @@ tests/*
# C extensions
*.so
logs/*.log
!logs/test.log
# Distribution / packaging
.Python
build/

View File

@ -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<path>\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')