-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: remove querystring #11428
base: master
Are you sure you want to change the base?
feat: remove querystring #11428
Conversation
Walkthrough本次更改主要包括对多个文件的修改。 Changes
Sequence Diagram(s)sequenceDiagram
participant U as 用户
participant AD as AvatarDropdown组件
participant B as 浏览器
U->>AD: 点击注销按钮
AD->>AD: 使用 URLSearchParams 构造重定向参数
AD->>B: 执行页面重定向至注销URL
Poem
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
您好,我是刘学炜,谢谢您的邮件,我会尽快查收并回复。祝您生活愉快
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/components/RightContent/AvatarDropdown.tsx (1)
54-54
: 使用了更现代的 URLSearchParams API!用
URLSearchParams
替代querystring
是一个很好的改进:
- 使用了浏览器原生 API
- 减少了外部依赖
- 提供了更好的 URL 参数处理能力
建议考虑进一步优化代码:
- search: new URLSearchParams(`redirect=${pathname}${search}`).toString(), + search: new URLSearchParams({ + redirect: `${pathname}${search}` + }).toString(),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.gitignore
(1 hunks)mock/user.ts
(1 hunks)package.json
(0 hunks)src/components/RightContent/AvatarDropdown.tsx
(2 hunks)
💤 Files with no reviewable changes (1)
- package.json
✅ Files skipped from review due to trivial changes (1)
- .gitignore
🔇 Additional comments (3)
src/components/RightContent/AvatarDropdown.tsx (1)
7-7
: 优化了 React 的导入方式!将 React 的导入改为类型导入是一个很好的优化,因为这个文件中只使用了 React 的类型定义。
mock/user.ts (2)
1-1
: 优化了 Express 类型的导入方式!将 Express 的
Request
和Response
改为类型导入是正确的,因为这些类型只用于类型注解。
3-3
: 简化了类型注解!移除了
time
参数的显式类型注解是合适的,因为:
- TypeScript 可以从默认值
100
自动推断出参数类型为number
- 代码更简洁,同时保持了类型安全
Summary by CodeRabbit
Chores
Refactor