Expand description
后台「个人资料」页面(/admin/profile)。
三个分区纵向排列:个人信息(头像、只读用户名、显示名称、邮箱,改动后才能保存)、
修改密码(当前密码、新密码与强度条、确认)、退出登录。username 是唯一登录凭据,
只读展示。启用 ADMIN_* 环境变量时顶部提示重启后以环境变量为准。保存成功后用
响应里的 PublicUser 刷新 UserContext,侧栏即时更新。密码强度条只在浏览器端
提示,不改变服务端校验。样式见 styles/pages/admin-profile.css。
Structs§
- Info
Section 🔒Props - Props for the
InfoSectioncomponent. - Password
Section 🔒Props - Props for the
PasswordSectioncomponent. - Profile
Props 🔒 - Props for the
Profilecomponent. - Profile
Route - 个人资料路由(无 SSR 数据,资料在客户端读取)。
Constants§
- MIN_
PASSWORD 🔒 - 新密码最短字符数,与服务端校验一致。
Functions§
- Info
Section 🔒 - 个人信息:头像、用户名、显示名称、邮箱。
- Password
Section 🔒 - 修改密码:当前密码、新密码(强度条)、确认新密码。
- Profile 🔒
- 后台个人资料页面。
- __
Profile 🔒Route_ View - password_
hint 🔒 - 强度条下方的说明。
- password_
level 🔒 - 密码强度 0–4:空、不足 8 位、8–11 位、12 位以上、12 位以上且含符号。