From 4587b7551c9833250393ef61f66c175cb46d5671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BC=BA?= <1206709430@qq.com> Date: Mon, 29 Mar 2021 23:37:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95(=E9=83=A8=E7=BD=B2=E6=B5=8B?= =?UTF-8?q?=E8=AF=95):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dvadmin-backend/apps/vadmin/op_drf/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dvadmin-backend/apps/vadmin/op_drf/middleware.py b/dvadmin-backend/apps/vadmin/op_drf/middleware.py index bf28947..fb60065 100644 --- a/dvadmin-backend/apps/vadmin/op_drf/middleware.py +++ b/dvadmin-backend/apps/vadmin/op_drf/middleware.py @@ -91,7 +91,7 @@ class PermissionModeMiddleware(MiddlewareMixin): :return: """ white_list = ['/admin/logout/', '/admin/login/'] - if os.getenv('DEMO_ENV') and not request.method == 'GET' and request.path not in white_list: + if os.getenv('DEMO_ENV') and not request.method in ['GET','OPTIONS'] and request.path not in white_list: return ErrorJsonResponse(data={}, msg=f'演示模式,不允许操作!') def has_interface_permission(self, request, method, view_path, user=None):