From 705c3169c43dbc35c0759817429a57ae65c920d2 Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 9 Jun 2025 18:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=88=B7=E6=96=B0=E6=97=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/dashboard/server.py | 2 +- admin/dashboard/templates/base.html | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/admin/dashboard/server.py b/admin/dashboard/server.py index 335a191..6562b71 100644 --- a/admin/dashboard/server.py +++ b/admin/dashboard/server.py @@ -89,7 +89,7 @@ class DashboardServer: app = Flask(__name__, template_folder=template_folder) app.secret_key = "stats_dashboard_secret_key" # 禁用模板缓存,使修改HTML文件后立即生效 False =重启才生效 - app.config['TEMPLATES_AUTO_RELOAD'] = False + app.config['TEMPLATES_AUTO_RELOAD'] = True # 设置Werkzeug日志级别为DEBUG import logging diff --git a/admin/dashboard/templates/base.html b/admin/dashboard/templates/base.html index 4135844..f8a43cb 100644 --- a/admin/dashboard/templates/base.html +++ b/admin/dashboard/templates/base.html @@ -274,11 +274,7 @@ const currentPath = window.location.pathname; const targetPath = routes[key]; if (currentPath !== targetPath && targetPath !== undefined) { - // 添加页面切换时的过渡效果 - document.querySelector('.app-container').classList.remove('loaded'); - setTimeout(() => { - window.location.href = targetPath; - }, 300); + window.location.href = targetPath; } }, loadData() { @@ -290,10 +286,7 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { - document.querySelector('.app-container').classList.remove('loaded'); - setTimeout(() => { - window.location.href = '/logout'; - }, 300); + window.location.href = '/logout'; }).catch(() => { // 用户点击取消,不做任何操作 });