fix: /api/develop/server_time/ get接口全部放行
This commit is contained in:
parent
7e318d9cfd
commit
0936687b1e
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
from rest_framework.exceptions import ParseError
|
from rest_framework.exceptions import ParseError
|
||||||
from rest_framework.permissions import IsAdminUser
|
from rest_framework.permissions import IsAdminUser, AllowAny
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.serializers import Serializer
|
from rest_framework.serializers import Serializer
|
||||||
from rest_framework.decorators import action
|
from rest_framework.decorators import action
|
||||||
|
|
@ -42,6 +42,11 @@ from datetime import datetime
|
||||||
class ServerTime(APIView):
|
class ServerTime(APIView):
|
||||||
permission_classes = [IsAdminUser]
|
permission_classes = [IsAdminUser]
|
||||||
|
|
||||||
|
def get_permissions(self):
|
||||||
|
if self.request.method == "GET":
|
||||||
|
return [AllowAny()]
|
||||||
|
return super().get_permissions()
|
||||||
|
|
||||||
@swagger_auto_schema(responses={200: ServerTimeSerializer})
|
@swagger_auto_schema(responses={200: ServerTimeSerializer})
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue