Skip to content

feat: 添加 SecretTextField 组件,敏感字段默认密文显示并支持切换#1773

Merged
coltea merged 1 commit intochaitin:mainfrom
GavanHub:feat/secret-field-visibility-toggle
Mar 19, 2026
Merged

feat: 添加 SecretTextField 组件,敏感字段默认密文显示并支持切换#1773
coltea merged 1 commit intochaitin:mainfrom
GavanHub:feat/secret-field-visibility-toggle

Conversation

@GavanHub
Copy link
Copy Markdown
Collaborator

@GavanHub GavanHub commented Mar 19, 2026

添加 SecretTextField 组件,敏感字段默认密文显示并支持切换

封装通用 SecretTextField 组件替代 TextField,为所有密码、密钥、Token 等敏感配置字段 添加密码显示/隐藏切换按钮,涉及访问认证、机器人配置、MCP 设置等 11 个组件。

变更类型

请勾选适用的变更类型:

  • Bug 修复 (不兼容变更的修复)
  • 新功能 (不兼容变更的新功能)
  • 功能改进 (不兼容现有功能的改进)
  • 文档更新
  • 依赖更新
  • 重构 (不影响功能的代码修改)
  • 测试用例
  • CI/CD 配置变更
  • 其他 (请描述):

封装通用 SecretTextField 组件替代 TextField,为所有密码、密钥、Token 等敏感配置字段
添加密码显示/隐藏切换按钮,涉及访问认证、机器人配置、MCP 设置等 11 个组件。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coltea coltea requested a review from Copilot March 19, 2026 10:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread web/admin/src/pages/setting/component/Common.tsx
Comment thread web/admin/src/pages/setting/component/CardRobotDiscord.tsx
Comment thread web/admin/src/pages/setting/component/CardRobotWecomAIBot.tsx
Comment thread web/admin/src/pages/setting/component/CardRobotApi.tsx
Comment thread web/admin/src/pages/setting/component/Common.tsx
@coltea coltea merged commit 46edaa8 into chaitin:main Mar 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants