mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-03 07:32:51 +08:00
后台右上角显示当前登录用户;退出登录按钮鼠标悬浮样式
This commit is contained in:
@@ -46,8 +46,8 @@
|
|||||||
var data = axiosData.data;
|
var data = axiosData.data;
|
||||||
if (status === "success") {
|
if (status === "success") {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
if(data) {
|
if (data) {
|
||||||
|
document.getElementById("nickname").innerHTML = "当前登录用户:" + data.nickname;
|
||||||
} else {
|
} else {
|
||||||
window.location.href = "/login";
|
window.location.href = "/login";
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,22 @@
|
|||||||
|
<style>
|
||||||
|
#btn-logout {
|
||||||
|
color: grey;
|
||||||
|
vertical-align: middle;
|
||||||
|
float: right;
|
||||||
|
transition: all 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#btn-logout:hover {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nickname {
|
||||||
|
color: rgb(176, 176, 176);
|
||||||
|
vertical-align: middle;
|
||||||
|
float: right;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<div class="navbar-grid">
|
<div class="navbar-grid">
|
||||||
<div class="grid-item"></div>
|
<div class="grid-item"></div>
|
||||||
@@ -8,7 +27,8 @@
|
|||||||
<% Object.keys(dashboardPage).forEach(item => { %>
|
<% Object.keys(dashboardPage).forEach(item => { %>
|
||||||
<a href="/dashboard/<%= group %>/<%= item %>" style="vertical-align: middle;"><%= dashboardPage[item].title %></a>
|
<a href="/dashboard/<%= group %>/<%= item %>" style="vertical-align: middle;"><%= dashboardPage[item].title %></a>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
<a href="javascript:logout();" style="color: grey; vertical-align: middle; float: right;">退出登录</a>
|
<a id="btn-logout" href="javascript:logout();">退出登录</a>
|
||||||
|
<span id="nickname"><!-- 用户昵称 --></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid-item"></div>
|
<div class="grid-item"></div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user