1. 修改了跳转逻辑
2. 增加了首页banner栏性能监控
This commit is contained in:
25
web/index.html
Normal file
25
web/index.html
Normal 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>
|
||||
Reference in New Issue
Block a user