获取寻息headers

This commit is contained in:
曹前明 2022-09-16 09:58:05 +08:00
parent a01f29d4a1
commit 2d53719338
2 changed files with 12 additions and 0 deletions

View File

@ -164,3 +164,6 @@ class SpClient:
"errors": errors
})
Tlog(**self.log).save()
def headers(self):
return self.headers

View File

@ -157,6 +157,15 @@ class XxCommonViewSet(CreateModelMixin, CustomGenericViewSet):
xxClient.subscribe('lowpower', '/api/third/xunxi/c_lowpower/')
return Response()
@action(methods=['get'], detail=False,
permission_classes=[IsAuthenticated])
def headers(self, request, pk=None):
"""获取headers
获取headers
"""
return Response(xxClient.headers())
@action(methods=['post'], detail=False,
permission_classes=[IsAdminUser],
serializer_class=serializers.Serializer)