fix: /api/develop/server_time/ get接口全部放行

This commit is contained in:
shijing 2026-08-12 16:12:42 +08:00
parent 7e318d9cfd
commit 0936687b1e
1 changed files with 6 additions and 1 deletions

View File

@ -2,7 +2,7 @@
from rest_framework.views import APIView
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.serializers import Serializer
from rest_framework.decorators import action
@ -42,6 +42,11 @@ from datetime import datetime
class ServerTime(APIView):
permission_classes = [IsAdminUser]
def get_permissions(self):
if self.request.method == "GET":
return [AllowAny()]
return super().get_permissions()
@swagger_auto_schema(responses={200: ServerTimeSerializer})
def get(self, request):
"""