feat(user): 用户系统重做——人机验证、30 天签到、主题色购买与退款、人品值
存储 - 目录改为 .GC/user/<用户名>/pw.yaml(用户名、积分、sha512 口令 + 盐) - .GC/user/user.yaml 记住当前登录(用户名 + session token),启动自动登录 - 自动迁移旧的 .GC/user/<用户名>.yaml 注册 / 登录 - 新增算术人机验证:GET /api/user/captcha(5 分钟有效、一次性、用后即焚) - 用户名不可重复、不能含空格、1–20 字符 - 口令只存 sha512(密码 + ":" + 随机盐),不存明文 - 新增 /api/user/logout 签到 - 30 天一循环:1–6 天 +10,第 7 天 +30,8–13 +15,第 14 天 +40, 15–20 +20,第 21 天 +50,22–27 +25,第 28 天 +60,29 天 +40,第 30 天 +100 - 断签重置连续天数;接口返回 cycle_day / next_reward / today_signed 主题色 - 默认蓝免费,预置色 50,自定义色 150(服务端算价,不信客户端) - 购买后 1 小时内换色退 80%,record 里存 theme_paid / theme_paid_at - 禁止充值:积分只能签到获得 前端用户页 - 账号卡片:积分、连续天数、周期进度条、一键签到、退出登录 - 注册表单内嵌验证码(换一题、失败自动刷新) - 人品值:0–100 随机 + 评语,每天不限次数 - 二选一:两个输入框随机选一个 - 主题色:8 个预置色 + 自定义色取色(十六进制 + 预览),积分不足上锁 - 应用主题色时同步覆盖全局强调色
This commit is contained in:
1 parent
e7c1429889
commit
ecb71ad347
7 files changed
+1419
-463
No files matched your search
@@ -124,9 +124,18 @@ public sealed record UpdateCheckDto(
|
||||
public sealed record ContributorDto(string Name, int Contributions, string? AvatarUrl);
|
||||
|
||||
// ---- 用户 API DTO ----
|
||||
public sealed record RegisterRequest(string Username, string Password);
|
||||
public sealed record RegisterRequest(
|
||||
string Username,
|
||||
string Password,
|
||||
string? CaptchaId = null,
|
||||
string? Captcha = null);
|
||||
|
||||
public sealed record LoginRequest(string Username, string Password);
|
||||
public sealed record ThemeRequest(string Color, int Cost);
|
||||
|
||||
/// <summary>换主题色:只传颜色,价格由服务端按预置/自定义判定。</summary>
|
||||
public sealed record ThemeRequest(string Color, int? Cost = null);
|
||||
|
||||
public sealed record CaptchaDto(string Id, string Question);
|
||||
|
||||
|
||||
/// <summary>「重新下载启动器」结果:State = Ready / UpToDate / Failed。</summary>
|
||||
|
||||
Reference in new issue
Block a user