diff --git a/dnfs/dnfs.py b/dnfs/dnfs.py index 1145a17..45b54d5 100755 --- a/dnfs/dnfs.py +++ b/dnfs/dnfs.py @@ -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() +''' diff --git a/gateway/src/main.cpp b/gateway/src/main.cpp index df1f0a4..d663e47 100644 --- a/gateway/src/main.cpp +++ b/gateway/src/main.cpp @@ -667,6 +667,8 @@ http::response 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()) diff --git a/static/public/index.html b/static/public/index.html index 46e9ce6..608b0f5 100644 --- a/static/public/index.html +++ b/static/public/index.html @@ -1,40 +1,48 @@ - + - - - 树状笔记 · 开源社区 + + + + DNFS 欢迎来到树状笔记 -