.1502411993651747:aea21d92f0384e3557507fa5551e8d36_69f5be91dc48703ced6cf216.69f5beb3dc48703ced6cf221.69f5beb326499c2a7e1f00c3:Trae CN.T(2026/5/2 17:06:59)#2
Open
lovely90133 wants to merge 2 commits into
Conversation
改进认证中间件的错误处理和令牌验证逻辑,增加对无效令牌和过期令牌的检测 在笔记更新和删除操作中添加用户ID验证,确保用户只能操作自己的笔记
将 findByIdAndUpdate 替换为 findOneAndUpdate,在同一个操作中同时检查权限和更新数据 避免潜在的竞态条件和权限绕过风险 test: 添加权限控制测试脚本 验证不同用户对笔记的访问权限,确保权限控制正常工作
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(笔记控制器): 优化更新笔记的原子性和权限检查
将 findByIdAndUpdate 替换为 findOneAndUpdate,在同一个操作中同时检查权限和更新数据
避免潜在的竞态条件和权限绕过风险
test: 添加权限控制测试脚本
验证不同用户对笔记的访问权限,确保权限控制正常工作