回调地址路由调整

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 # C extensions
*.so *.so
logs/*.log logs/*.log
!logs/test.log
# Distribution / packaging # Distribution / packaging
.Python .Python
build/ build/

View File

@ -9,10 +9,9 @@ from apps.jqr.serializers import WechatPublicTokenSerializer, WechatEncryptSeria
class WechatWorkerViewSet(viewsets.GenericViewSet): class WechatWorkerViewSet(viewsets.GenericViewSet):
@action(methods=['GET'], detail=False, serializer_class=WechatPublicTokenSerializer, url_path='event') @action(methods=['GET'], detail=False, serializer_class=WechatPublicTokenSerializer, url_path=r'event/(?P<path>\w+)',)
def verify(self, request): def verify(self, request, path, *args, **kwargs):
print(self.request._request.path) [business, corpid, agentid, uid] = path.split('_')
print(request.query_params)
serializer = self.get_serializer(data=request.query_params) serializer = self.get_serializer(data=request.query_params)
serializer.is_valid(raise_exception=True) serializer.is_valid(raise_exception=True)
enchostr = serializer.data.get('echostr') enchostr = serializer.data.get('echostr')