1. 修改了跳转逻辑

2. 增加了首页banner栏性能监控
This commit is contained in:
2026-01-21 09:42:38 +08:00
parent 861a4f4833
commit 5be838a74e
5 changed files with 140 additions and 2 deletions

25
web/index.html Normal file
View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>跳转中...</title>
</head>
<body>
<p>正在检查登录状态...</p>
<script>
// 会话超时检查5分钟
const SESSION_TIMEOUT = 5 * 60 * 1000; // 5分钟
const loginTime = localStorage.getItem('loginTime');
if (!loginTime || (Date.now() - parseInt(loginTime)) > SESSION_TIMEOUT) {
// 会话过期,跳转登录页
localStorage.removeItem('loginTime');
localStorage.removeItem('username');
window.location.href = 'pages/login.html';
} else {
// 会话有效,跳转主页
localStorage.setItem('loginTime', Date.now());
window.location.href = 'pages/main.html';
}
</script>
</body>
</html>