From 133774ced799b3b4226d0aa523554ab3a49c7ffd Mon Sep 17 00:00:00 2001 From: funewa Date: Tue, 7 Feb 2023 06:19:53 +0000 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E4=B8=AD=E7=9A=84=20Content-?= =?UTF-8?q?Type=20=E4=B8=8D=E6=98=AF=20application/json=EF=BC=8C=E5=88=99?= =?UTF-8?q?=E4=BB=8E=20request.values=20=E4=B8=AD=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: funewa --- applications/common/admin_log.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/common/admin_log.py b/applications/common/admin_log.py index 807766e..a75080d 100644 --- a/applications/common/admin_log.py +++ b/applications/common/admin_log.py @@ -32,12 +32,13 @@ def login_log(request, uid, is_access): def admin_log(request, is_access): + request_data = request.json if request.headers.get('Content-Type') == 'application/json' else request.values info = { 'method': request.method, 'url': request.path, 'ip': request.remote_addr, 'user_agent': str_escape(request.headers.get('User-Agent')), - 'desc': str_escape(str(dict(request.values if request.method == 'GET' else request.json))), + 'desc': str_escape(str(dict(request_data))), 'uid': current_user.id, 'success': int(is_access) -- Gitee