From 7690343ed18313ed770f79e149965aa45afc74b3 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Wed, 31 Aug 2022 14:49:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E6=93=8D=E4=BD=9C=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.py b/app.py index b6f41c2..c49ccd1 100644 --- a/app.py +++ b/app.py @@ -131,6 +131,12 @@ def admin_view_rule(name): def admin_clear_rule(name): if not name or not name.split('.')[-1] in ['js','txt','py','json']: return jsonify(error.failed(f'非法猥亵,未指定文件名。必须包含js|txt|json|py')) + cookies = request.cookies + # print(cookies) + token = cookies.get('token', '') + # print(f'mytoken:{token}') + if not verfy_token(token): + return render_template('login.html') file_path = os.path.abspath(f'js/{name}') if not os.path.exists(file_path): -- GitLab