优化XSS过滤

This commit is contained in:
zmister 2021-09-08 00:04:55 +08:00
parent d2eda66cb7
commit 123c7e3bda
2 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@ from app_api.auth_app import AppAuth,AppMustAuth # 自定义认证
from app_api.permissions_app import SuperUserPermission # 自定义权限 from app_api.permissions_app import SuperUserPermission # 自定义权限
from app_admin.decorators import superuser_only,open_register from app_admin.decorators import superuser_only,open_register
from app_doc.models import * from app_doc.models import *
from app_doc.views import jsonXssFilter
from app_admin.models import * from app_admin.models import *
from app_admin.utils import * from app_admin.utils import *
from loguru import logger from loguru import logger
@ -685,7 +686,7 @@ def admin_doc(request):
"code": 0, "code": 0,
"msg": "ok", "msg": "ok",
"count": doc_list.count(), "count": doc_list.count(),
"data": table_data "data": jsonXssFilter(table_data)
} }
return JsonResponse(resp_data) return JsonResponse(resp_data)

View File

@ -1451,7 +1451,7 @@ def manage_doc(request):
"code": 0, "code": 0,
"msg": "ok", "msg": "ok",
"count": doc_list.count(), "count": doc_list.count(),
"data": table_data "data": jsonXssFilter(table_data)
} }
return JsonResponse(resp_data) return JsonResponse(resp_data)