From bda002398c0a600d26dd986b31bc72f5e454d5fc Mon Sep 17 00:00:00 2001 From: 1638245306 <1638245306@qq.com> Date: Tue, 29 Apr 2025 14:45:45 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=20API=20?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=9D=83=E9=99=90=E4=B8=BA=E4=BB=85=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E8=AE=A4=E8=AF=81=E7=94=A8=E6=88=B7=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 API 文档的权限设置从 AllowAny 更改为 IsAuthenticated- 确保只有经过身份验证的用户才能访问 API 文档 --- backend/application/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/application/urls.py b/backend/application/urls.py index cb5a899..641b85c 100644 --- a/backend/application/urls.py +++ b/backend/application/urls.py @@ -50,7 +50,7 @@ schema_view = get_schema_view( license=openapi.License(name="BSD License"), ), public=True, - permission_classes=(permissions.AllowAny,), + permission_classes=(permissions.IsAuthenticated,), generator_class=CustomOpenAPISchemaGenerator, ) # 前端页面映射