feat(web): 支持登录密码显示与隐藏

原因:登录时缺少密码可见性切换,长密码输入难以核对。

影响:新增可复用 PasswordInput,在登录表单提供眼睛按钮,并补充禁用态、焦点样式和无障碍标签。

风险:密码仅在用户主动点击时于当前输入框显示,不改变提交、存储或日志行为。

验证:前端 112 项测试通过;pnpm lint 通过;@easyai-ai-gateway/web 生产构建通过。
This commit is contained in:
2026-07-24 23:27:28 +08:00
parent 1fc80ffe23
commit d7a0ec56f5
4 changed files with 108 additions and 3 deletions
+2 -3
View File
@@ -1,6 +1,6 @@
import type { FormEvent } from 'react';
import { LogIn, UserPlus } from 'lucide-react';
import { Button, Card, CardContent, CardHeader, CardTitle, Input, Label, Tabs } from './ui';
import { Button, Card, CardContent, CardHeader, CardTitle, Input, Label, PasswordInput, Tabs } from './ui';
import type { AuthMode, LoadState, LoginForm, RegisterForm } from '../types';
const tabs = [
@@ -70,9 +70,8 @@ function LoginFormView(props: {
</Label>
<Label>
<Input
<PasswordInput
autoComplete="current-password"
type="password"
value={props.loginForm.password}
onChange={(event) => props.onLoginChange({ ...props.loginForm, password: event.target.value })}
placeholder="至少 8 位"