修复BUG(提交错误): DEMO_ENV

pull/12/head
李强 2021-03-30 01:28:09 +08:00
parent 070d3e04ad
commit a37550176c
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ class PermissionModeMiddleware(MiddlewareMixin):
def process_view(self, request, view_func, view_args, view_kwargs):
# 判断环境变量中,是否为演示模式(正常可忽略此判断)
white_list = ['/admin/logout/', '/admin/login/']
if not os.getenv('DEMO_ENV') and not request.method in ['GET', 'OPTIONS'] 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'演示模式,不允许操作!')
if not settings.INTERFACE_PERMISSION: