feat:限制必须api-key或登录4

v3.2
panyy 2026-06-29 17:16:01 +08:00
parent 2abb8f154f
commit f2c8387e97
1 changed files with 4 additions and 2 deletions

View File

@ -99,8 +99,10 @@ class AnonymousAuthentication(APIView):
)
def post(self, request: Request):
return result.success(
AnonymousAuthenticationSerializer(data={'access_token': request.data.get("access_token")}).auth(
request),
AnonymousAuthenticationSerializer(data={
'access_token': request.data.get("access_token"),
'api_key': request.data.get("api_key"),
}).auth(request),
headers={"Access-Control-Allow-Origin": "*", "Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Methods": "POST",
"Access-Control-Allow-Headers": "Origin,Content-Type,Cookie,Accept,Token"}