feat(static): 首页添加登录态检测与进入笔记入口
- index.html: lang 改为 zh-CN,新增"关于本站"介绍段落,按钮改为有 id 的登录/注册/进入/退出四按钮(默认隐藏进入/退出) - 新增 index.js: POST /whoami 检测登录态(HttpOnly Cookie 自动携带),已登录则显示用户名+进入笔记/退出按钮,未登录显示登录/注册 - 退出按钮调用 POST /logout 后刷新页面
This commit is contained in:
1 parent
84adec4722
commit
1a5e9f7064
2 files changed
+61
-5
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -24,6 +24,13 @@
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.site-intro {
|
||||
max-width: 640px;
|
||||
margin: 0 auto;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.9;
|
||||
color: var(--fg-secondary);
|
||||
}
|
||||
</style>
|
||||
<title>DNFS 欢迎来到树状笔记</title>
|
||||
</head>
|
||||
@@ -33,16 +40,23 @@
|
||||
<div class="right-group">
|
||||
<img src="favicon.ico" alt="头像加载失败" id="avatar" width="70px" height="70px" style="border-radius: 100px;">
|
||||
<b id="name">DNFS</b>
|
||||
<button onclick="window.location.href='login.html'">登录</button>
|
||||
<button onclick="window.location.href='register.html'">注册</button>
|
||||
<button id="enterBtn" onclick="window.location.href='dnfs.html'" style="display:none">进入笔记</button>
|
||||
<button id="logoutBtn" style="display:none">退出</button>
|
||||
<button id="loginBtn" onclick="window.location.href='login.html'">登录</button>
|
||||
<button id="registerBtn" onclick="window.location.href='register.html'">注册</button>
|
||||
</div>
|
||||
</header>
|
||||
<div id="main-page">
|
||||
<h2>推荐节点</h2>
|
||||
<div id="recommended-node"></div>
|
||||
<h2>关于本站</h2>
|
||||
<p class="site-intro">
|
||||
DNFS 树状笔记是一个以树状结构组织内容的笔记社区:每个节点都可以生长出子节点,
|
||||
像树枝一样层层延展,让知识自然成体系。支持 Markdown 文本、链接卡片、图片与文件分享,
|
||||
注册登录后即可创建属于你自己的知识树。
|
||||
</p>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">蜀ICP备2024107064号-2</a>
|
||||
</footer>
|
||||
<script src="js/index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user