feat: 注册关闭时页面隐藏表单并显示友好提示,保留登录入口
- RegisterPage 传入 RegistrationEnabled 标志到模板 - 注册关闭时隐藏输入框和按钮,显示“当前暂不开放注册”提示 - 保留“已有账号?立即登录”链接 - API 层已有拦截(AuthService.Register 返回 403),无需修改 - authUseCase 接口新增 IsRegistrationEnabled 方法(ISP)
This commit is contained in:
@ -52,6 +52,11 @@ func validatePassword(pw string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsRegistrationEnabled 检查是否允许新用户注册
|
||||
func (s *AuthService) IsRegistrationEnabled() bool {
|
||||
return s.siteSettings.IsRegistrationEnabled()
|
||||
}
|
||||
|
||||
// Register 注册
|
||||
// 流程:密码强度 → 邮箱查重 → 哈希 → 生成唯一用户名 → 创建 → access JWT + refresh JWT
|
||||
// rememberMe=true: refresh Cookie 持久化(30天);false: session cookie(关浏览器即清除)
|
||||
|
||||
Reference in New Issue
Block a user