feat: 注册关闭时页面隐藏表单并显示友好提示,保留登录入口
- RegisterPage 传入 RegistrationEnabled 标志到模板 - 注册关闭时隐藏输入框和按钮,显示“当前暂不开放注册”提示 - 保留“已有账号?立即登录”链接 - API 层已有拦截(AuthService.Register 返回 403),无需修改 - authUseCase 接口新增 IsRegistrationEnabled 方法(ISP)
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
<div class="auth-card">
|
||||
<h2>创建账号</h2>
|
||||
<p class="auth-subtitle">加入 MetaLab 开发者社区</p>
|
||||
{{if .RegistrationEnabled}}
|
||||
<form id="registerForm" novalidate>
|
||||
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
|
||||
<div class="form-group">
|
||||
@ -34,6 +35,12 @@
|
||||
<p class="guidelines-link">点击注册即表示同意 <a href="javascript:void(0)" id="openGuidelines">《MetaLab 社区用户准则》</a></p>
|
||||
<button type="submit" class="submit-btn" id="submitBtn">注 册</button>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="registration-closed">
|
||||
<p class="closed-message">当前暂不开放注册,敬请期待</p>
|
||||
<p class="closed-subtitle">社区正在维护中,请稍后再来</p>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="auth-footer">
|
||||
已有账号?<a href="/auth/login">立即登录</a>
|
||||
</div>
|
||||
|
||||
@ -36,6 +36,25 @@
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
/* ---------- Registration Closed Notice ---------- */
|
||||
.registration-closed {
|
||||
text-align: center;
|
||||
padding: 2.5rem 1rem;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
||||
.registration-closed .closed-message {
|
||||
font-size: 1.05rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-primary);
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
||||
.registration-closed .closed-subtitle {
|
||||
font-size: .9rem;
|
||||
color: var(--color-secondary);
|
||||
}
|
||||
|
||||
/* ---------- Form ---------- */
|
||||
.form-group {
|
||||
margin-bottom: 1.2rem;
|
||||
|
||||
Reference in New Issue
Block a user