DEV
This commit is contained in:
1 parent
974c912d9e
commit
13f3eb8f88
4 files changed
+78
-31
No files matched your search
@@ -450,6 +450,43 @@ def update_note():
|
||||
logs.error('dnfs', f'update_note 失败 id={id}', extra={'user': info['user']})
|
||||
return jsonify({'success': False}), 400
|
||||
|
||||
## by shufeng
|
||||
## 读取单个节点
|
||||
'''@app.route("/get_note", methods=["POST"])
|
||||
|
||||
def get_note():
|
||||
data = request.get_json()
|
||||
|
||||
id: int = data.get("id")
|
||||
auth: str = request.headers.get("Authorization", "")
|
||||
info = None
|
||||
|
||||
if auth.startswith("Bearer "):
|
||||
token: str = auth[7:]
|
||||
info = decode_token(token)
|
||||
|
||||
if id is None:
|
||||
logs.error("dnfs", "get_note: 参数不足,缺少id")
|
||||
return jsonify({"error": "Invalid param"}), 401
|
||||
|
||||
select_payload = {
|
||||
"method": "select",
|
||||
"tables": "Notes",
|
||||
"where": {
|
||||
"id": id
|
||||
}
|
||||
}
|
||||
|
||||
data = _call_dbv2(select_payload)
|
||||
notes = data["data"]
|
||||
|
||||
if not len(notes) == 1 or not notes[0]["owner"] == info["user"]:
|
||||
logs.error("dnfs", "没有读取权")
|
||||
return jsonify({"error": "你没有读取这个的权力"}), 403
|
||||
|
||||
logs.info("dnfs", f"get_note 查询 id={id}")
|
||||
return jsonify()
|
||||
'''
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -667,6 +667,8 @@ http::response<http::string_body> handleLogin(
|
||||
auto password = std::string(obj.at("password").as_string());
|
||||
|
||||
// CAPTCHA verification 验证码
|
||||
// 浏览器请求验证码端口,获取验证图片和身份证(速率限制),身份证对应验证码
|
||||
// gateway请求验证端口,输入用户的验证和身份证
|
||||
//auto captcha_it = obj.find("captcha_token");
|
||||
//auto captcha_ans_it = obj.find("captcha_answer");
|
||||
//if (captcha_it == obj.end() || captcha_ans_it == obj.end())
|
||||
|
||||
+39
-31
@@ -1,40 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
|
||||
<title>树状笔记 · 开源社区</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="css/theme.css">
|
||||
<style>
|
||||
body {
|
||||
align-items: normal;
|
||||
}
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
.right-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.right-group > img,
|
||||
.right-group > b,
|
||||
.right-group > button {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
<title>DNFS 欢迎来到树状笔记</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="landing" style="display:none">
|
||||
<div class="card" style="max-width:400px;margin:60px auto;padding:40px;text-align:center">
|
||||
<h1 style="color:var(--accent)">树状笔记</h1>
|
||||
<p style="color:var(--fg-secondary);line-height:1.6">一个开源的、基于树状结构的知识组织文件管理工具</p>
|
||||
<div style="margin-top:1.5rem;display:flex;gap:0.75rem;justify-content:center">
|
||||
<a class="btn-primary" href="login.html" style="padding:0.6rem 1.8rem;font-size:0.9rem;font-weight:600;border-radius:var(--radius-sm);text-decoration:none;color:#fff;background:var(--accent)">登录</a>
|
||||
<a class="btn-ghost" href="register.html" style="padding:0.6rem 1.8rem;font-size:0.9rem;font-weight:600;border-radius:var(--radius-sm);text-decoration:none;color:var(--accent-dark);border:1.5px solid var(--border)">注册</a>
|
||||
</div>
|
||||
<p style="margin-top:1.5rem;font-size:0.8rem;color:var(--muted)">开源 · 免费 · 共享</p>
|
||||
<header class="header">
|
||||
<h1 onclick="window.location.href='index.html'">DNFS 树状笔记</h1>
|
||||
<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>
|
||||
</div>
|
||||
</header>
|
||||
<div id="main-page">
|
||||
<h2>推荐节点</h2>
|
||||
<div id="recommended-node"></div>
|
||||
</div>
|
||||
<div id="app" style="display:none">
|
||||
<iframe src="dnfs.html" style="width:100%;height:100vh;border:none"></iframe>
|
||||
</div>
|
||||
<script>
|
||||
(function(){
|
||||
var t = sessionStorage.getItem('q4_token') || localStorage.getItem('q4_token');
|
||||
if(t){
|
||||
document.getElementById('landing').style.display='none';
|
||||
document.getElementById('app').style.display='block';
|
||||
} else {
|
||||
document.getElementById('landing').style.display='block';
|
||||
document.getElementById('app').style.display='none';
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<footer style="text-align:center;padding:1rem;font-size:0.75rem;color:var(--muted)">
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener" style="color:var(--muted)">蜀ICP备2024107064号-2</a>
|
||||
</footer>
|
||||
<footer class="footer">
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">蜀ICP备2024107064号-2</a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
Whitespace-only changes.
Reference in new issue
Block a user