feat: 添加 SecretTextField 组件,敏感字段默认密文显示并支持切换#1773
Merged
coltea merged 1 commit intochaitin:mainfrom Mar 19, 2026
Merged
Conversation
封装通用 SecretTextField 组件替代 TextField,为所有密码、密钥、Token 等敏感配置字段 添加密码显示/隐藏切换按钮,涉及访问认证、机器人配置、MCP 设置等 11 个组件。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
该 PR 在管理端设置页封装并引入 SecretTextField,用于密码/密钥/Token 等敏感配置默认密文显示,并提供一键显示/隐藏切换,提升配置录入时的安全性与可用性。
Changes:
- 在
Common.tsx新增通用SecretTextField(基于 MUI TextField + endAdornment 切换按钮)。 - 将多个设置卡片中的敏感输入项从
TextField替换为SecretTextField(认证、机器人、MCP 等)。
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web/admin/src/pages/setting/component/Common.tsx | 新增 SecretTextField 组件并在设置模块内复用 |
| web/admin/src/pages/setting/component/CardRobotWecomService.tsx | 企业微信服务相关敏感字段改用 SecretTextField |
| web/admin/src/pages/setting/component/CardRobotWecomAIBot.tsx | 企业微信智能机器人敏感字段改用 SecretTextField |
| web/admin/src/pages/setting/component/CardRobotWecom.tsx | 企业微信应用敏感字段改用 SecretTextField |
| web/admin/src/pages/setting/component/CardRobotWechatOfficeAccount.tsx | 微信公众号敏感字段改用 SecretTextField |
| web/admin/src/pages/setting/component/CardRobotLark.tsx | Lark 机器人敏感字段改用 SecretTextField |
| web/admin/src/pages/setting/component/CardRobotFeishu.tsx | 飞书机器人敏感字段改用 SecretTextField |
| web/admin/src/pages/setting/component/CardRobotDiscord.tsx | Discord 机器人 Token 改用 SecretTextField |
| web/admin/src/pages/setting/component/CardRobotDing.tsx | 钉钉机器人 Client Secret 改用 SecretTextField |
| web/admin/src/pages/setting/component/CardRobotApi.tsx | 问答机器人 API Token 改用 SecretTextField |
| web/admin/src/pages/setting/component/CardMCP.tsx | MCP 访问口令改用 SecretTextField |
| web/admin/src/pages/setting/component/CardAuth.tsx | 认证配置中的密码/Client Secret 等敏感字段改用 SecretTextField |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
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.
添加 SecretTextField 组件,敏感字段默认密文显示并支持切换
封装通用 SecretTextField 组件替代 TextField,为所有密码、密钥、Token 等敏感配置字段 添加密码显示/隐藏切换按钮,涉及访问认证、机器人配置、MCP 设置等 11 个组件。
变更类型
请勾选适用的变更类型: