解决刷新时样式失效问题。
This commit is contained in:
@@ -89,7 +89,7 @@ class DashboardServer:
|
|||||||
app = Flask(__name__, template_folder=template_folder)
|
app = Flask(__name__, template_folder=template_folder)
|
||||||
app.secret_key = "stats_dashboard_secret_key"
|
app.secret_key = "stats_dashboard_secret_key"
|
||||||
# 禁用模板缓存,使修改HTML文件后立即生效 False =重启才生效
|
# 禁用模板缓存,使修改HTML文件后立即生效 False =重启才生效
|
||||||
app.config['TEMPLATES_AUTO_RELOAD'] = False
|
app.config['TEMPLATES_AUTO_RELOAD'] = True
|
||||||
|
|
||||||
# 设置Werkzeug日志级别为DEBUG
|
# 设置Werkzeug日志级别为DEBUG
|
||||||
import logging
|
import logging
|
||||||
|
|||||||
@@ -274,11 +274,7 @@
|
|||||||
const currentPath = window.location.pathname;
|
const currentPath = window.location.pathname;
|
||||||
const targetPath = routes[key];
|
const targetPath = routes[key];
|
||||||
if (currentPath !== targetPath && targetPath !== undefined) {
|
if (currentPath !== targetPath && targetPath !== undefined) {
|
||||||
// 添加页面切换时的过渡效果
|
window.location.href = targetPath;
|
||||||
document.querySelector('.app-container').classList.remove('loaded');
|
|
||||||
setTimeout(() => {
|
|
||||||
window.location.href = targetPath;
|
|
||||||
}, 300);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadData() {
|
loadData() {
|
||||||
@@ -290,10 +286,7 @@
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
document.querySelector('.app-container').classList.remove('loaded');
|
window.location.href = '/logout';
|
||||||
setTimeout(() => {
|
|
||||||
window.location.href = '/logout';
|
|
||||||
}, 300);
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// 用户点击取消,不做任何操作
|
// 用户点击取消,不做任何操作
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user