feat(auth): 增强注册流程并完善默认邮箱初始化

- 注册页支持选择可用域名并自动创建邮箱,密码输入改为可见性切换组件。
- 后端默认管理员不再依赖固定密码,未配置时自动生成随机密码并创建对应域名、邮箱和欢迎消息。
- 公共配置接口返回可注册域名,补充 404 页面与相关路由。
- 更新测试以适配新的默认种子数据和邮箱创建逻辑。
This commit is contained in:
LanQin_
2026-06-16 10:39:49 +08:00
parent 45122162d0
commit 556389b734
12 changed files with 266 additions and 43 deletions
+4 -3
View File
@@ -12,6 +12,7 @@ import { useMe } from "@/hooks/use-me"
import { useLogout } from "@/hooks/use-logout"
import { validatePasswordConfirm } from "@/lib/validation"
import { Button } from "@/components/ui/button"
import { PasswordInput } from "@/components/ui/password-input"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Badge } from "@/components/ui/badge"
@@ -351,14 +352,14 @@ function ProfileOverview({ user, profile, password, passwordFormRef, stats, disp
<CardContent>
<form ref={passwordFormRef} className="space-y-4" onSubmit={(e) => { e.preventDefault(); password.mutate(new FormData(e.currentTarget)) }}>
<Field label="当前密码">
<Input name="currentPassword" type="password" required />
<PasswordInput name="currentPassword" required />
</Field>
<div className="grid gap-4 md:grid-cols-2">
<Field label="新密码">
<Input name="newPassword" type="password" minLength={8} required />
<PasswordInput name="newPassword" minLength={8} required />
</Field>
<Field label="确认新密码">
<Input name="confirmPassword" type="password" minLength={8} required />
<PasswordInput name="confirmPassword" minLength={8} required />
</Field>
</div>
<div className="flex justify-end">