1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-21 01:10:39 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

优化服务器连接失败提示;优化登录界面输入框回车处理

This commit is contained in:
2022-04-05 12:56:17 +08:00
parent 3d2d0c42fb
commit 412ec19cf2
11 changed files with 71 additions and 2 deletions

View File

@@ -37,7 +37,12 @@
})
.catch(function (error) {
console.log(error);
alert("退出登录失败");
var choice = confirm("服务器连接失败,无法正常退出登录,是否要强行退出登录?");
if(choice) {
localStorage.clear("token");
localStorage.clear("is_admin");
location.href = "/login";
}
});
}
</script>

View File

@@ -3,13 +3,39 @@
<head>
<%- include("../component/header.html"); %>
<%- include("../component/header-user.html"); %>
<style>
#container {
display: grid;
grid-template-columns: 1fr;
gap: 30px;
place-items: center;
margin-top: 40px;
}
.mainNav {
vertical-align: middle;
margin: 0 8px;
transition: 0.26s;
}
.mainNav:hover {
color: #fff;
background-color: black;
padding: 5px 8px;
border-radius: 4px;
transform: scale(1.2);
}
</style>
</head>
<body>
<%- include("../component/navbar.html"); %>
<main class="main">
<h1><%= headText %></h1>
<div id="container">
<% links.forEach(item=> { %>
<nobr>
<a class="mainNav" href="<%= item.url %>"><%= item.name %></a>
</nobr>
<% }); %>
</div>
</main>
<%- include("../component/footer-user.html"); %>

View File

@@ -41,6 +41,7 @@
}
}).catch(function (error) {
console.log(error);
alert("无法连接到服务器,请检查网络连接!");
});
}
if(localStorage.token != null) {
@@ -72,6 +73,7 @@
}
}).catch(function (error) {
console.log(error);
alert("无法连接到服务器,请检查网络连接!");
});
}
</script>