mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-16 23:22:20 +08:00
重新引入Redis;用户登录与管理员登录完成;引入NanoID代替UUID;调整Spring Boot idea中的启动参数;swagger页面描述信息完善;更新swagger,更新Api文档
This commit is contained in:
45
bookshelfplus-frontend/views/dashboard/component/navbar.html
Normal file
45
bookshelfplus-frontend/views/dashboard/component/navbar.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<div class="navbar">
|
||||
<div class="navbar-grid">
|
||||
<div class="grid-item"></div>
|
||||
<div class="grid-item">
|
||||
<nobr>
|
||||
<h1 onclick="location.href='/'" style="cursor: pointer;">书栖网</h1>
|
||||
</nobr>
|
||||
</div>
|
||||
<div class="grid-item exnarrowHide" style="text-align: right; color: white;">
|
||||
<a href="/">首页</a>
|
||||
<a href="/admin/manage">管理</a>
|
||||
<a style="color: grey;" href="javascript:logout();">退出登录</a>
|
||||
</div>
|
||||
<div class="grid-item"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function logout() {
|
||||
getRequest("/user/logout", { token: localStorage.getItem("token") })
|
||||
.then(function (response) {
|
||||
var axiosData = response.data;
|
||||
var status = axiosData.status;
|
||||
var data = axiosData.data;
|
||||
|
||||
if (status === "success") {
|
||||
console.log(data);
|
||||
if(data) {
|
||||
localStorage.clear("token");
|
||||
localStorage.clear("is_admin");
|
||||
// alert("退出登录成功");
|
||||
// window.location.href = "/";
|
||||
location.reload();
|
||||
} else {
|
||||
alert("退出登录失败");
|
||||
}
|
||||
} else {
|
||||
alert(`出错啦!${data.errMsg} (错误码: ${data.errCode}) `);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
alert("退出登录失败");
|
||||
});
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user