feat: 完善个人主页账户设置与真实学习统计 - #31
Merged
Merged
Conversation
added 30 commits
July 31, 2026 15:32
added 26 commits
July 31, 2026 15:47
| onClose(); | ||
| }; | ||
|
|
||
| return <Modal onClose={submitting ? undefined : onClose} className="profile-edit-modal"><p className="eyebrow">EDIT PROFILE</p><h2>编辑个人资料</h2><p className="modal-lead">修改你的展示用户名或个人头像。</p><form className="profile-edit-form" onSubmit={submit}><div className="profile-edit-avatar"><img src={previewUrl} alt="头像预览" /><div><strong>个人头像</strong><small>支持 JPEG、PNG,文件不超过 2 MiB</small><label className="profile-avatar-picker">选择新头像<input type="file" accept="image/jpeg,image/png" disabled={submitting} onChange={selectAvatar} /></label></div></div><label className="profile-edit-name">用户名<input type="text" minLength={1} maxLength={80} required disabled={submitting} value={nickname} onChange={(event) => setNickname(event.target.value)} /></label>{error && <p className="form-error" role="alert">{error}</p>}<div className="modal-actions"><Button type="button" variant="secondary" disabled={submitting} onClick={onClose}>取消</Button><Button type="submit" disabled={submitting}>{submitting ? "正在保存" : "保存修改"}</Button></div></form></Modal>; |
There was a problem hiding this comment.
The profile edit dialog allows 80 characters here, but UpdateProfileRequest and the user.nickname column cap nicknames at 32. Users can enter a value that the API will reject on submit, so the UI limit should match the backend contract.
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.
改动说明
本次 PR 完成个人主页账户与设置中心改造,接入用户资料、真实学习统计、自动打卡、头像管理和密码修改等功能。
主要改动
auth_version使全部旧登录状态失效。practice_session会话事实记录,通过会话开始和结束时间计算学习时长。数据库变更
"user"表新增avatar_object_key字段。practice_session表,记录:现有环境可以执行:
psql "$DATABASE_URL" -f deploy/postgres/profile.sql