feat: 注册关闭时页面隐藏表单并显示友好提示,保留登录入口

- RegisterPage 传入 RegistrationEnabled 标志到模板
- 注册关闭时隐藏输入框和按钮,显示“当前暂不开放注册”提示
- 保留“已有账号?立即登录”链接
- API 层已有拦截(AuthService.Register 返回 403),无需修改
- authUseCase 接口新增 IsRegistrationEnabled 方法(ISP)
This commit is contained in:
2026-05-30 20:38:55 +08:00
parent 90d17ed4b1
commit fb2eff5f23
5 changed files with 38 additions and 5 deletions

View File

@ -6,12 +6,13 @@ import (
"metazone.cc/metalab/internal/service"
)
// authUseCase AuthController 对 AuthService 的最小依赖ISP4 个方法)
// authUseCase AuthController 对 AuthService 的最小依赖ISP5 个方法)
type authUseCase interface {
Register(req model.RegisterRequest, regIP string) (string, string, *model.User, error)
Login(req model.LoginRequest, loginIP string) (string, string, *model.User, error)
ConfirmRestore(req model.LoginRequest, loginIP string) (string, string, *model.User, error)
CheckEmail(email string) (bool, error)
IsRegistrationEnabled() bool
}
// tokenRefresher AuthController 对 TokenService 的最小依赖ISP1 个方法)