From 0001c8f0d3c1c060d19a27378e7fc90e6a909254 Mon Sep 17 00:00:00 2001 From: wzj <244142824@qq.com> Date: Sun, 15 Jun 2025 08:00:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=89=B9=E9=87=8F=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/app.py b/app.py index 9d6cf17..7f11430 100644 --- a/app.py +++ b/app.py @@ -1533,41 +1533,6 @@ def download_crl(ca_id): return redirect(url_for('ca_detail', ca_id=ca_id)) -@app.route('/certificates') -@login_required -def certificate_list(): - conn = get_db_connection() - if conn: - try: - cursor = conn.cursor(dictionary=True) - if current_user.is_admin: - cursor.execute(""" - SELECT c.*, ca.name as ca_name - FROM certificates c - JOIN certificate_authorities ca ON c.ca_id = ca.id - ORDER BY c.created_at DESC - """) - else: - cursor.execute(""" - SELECT c.*, ca.name as ca_name - FROM certificates c - JOIN certificate_authorities ca ON c.ca_id = ca.id - WHERE c.created_by = %s - ORDER BY c.created_at DESC - """, (current_user.id,)) - certificates = cursor.fetchall() - return render_template('certificate_list.html', certificates=certificates, get_username=get_username) - except Error as e: - print(f"Database error: {e}") - flash('获取证书列表失败', 'danger') - return redirect(url_for('index')) - finally: - if conn.is_connected(): - cursor.close() - conn.close() - return redirect(url_for('index')) - - @app.route('/certificates/create', methods=['GET', 'POST']) @login_required def create_certificate_view():