mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-21 01:10:39 +08:00
优化服务器连接失败提示;优化登录界面输入框回车处理
This commit is contained in:
@@ -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>
|
||||
|
@@ -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"); %>
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user