79 lines
3.9 KiB
HTML
79 lines
3.9 KiB
HTML
{% extends "base.html" %}
|
||
|
||
{% block title %}用户注册{% endblock %}
|
||
|
||
{% block content %}
|
||
<div class="row justify-content-center mt-5">
|
||
<div class="col-md-6 col-lg-5">
|
||
<div class="card border-0 shadow-sm">
|
||
<div class="card-header bg-light">
|
||
<h4 class="card-title mb-0">
|
||
<i class="fas fa-user-plus text-primary me-2"></i>用户注册
|
||
</h4>
|
||
</div>
|
||
<div class="card-body">
|
||
<form method="POST" action="{{ url_for('register') }}">
|
||
<div class="mb-3">
|
||
<label for="username" class="form-label">
|
||
<i class="fas fa-user me-1 text-muted"></i>用户名
|
||
</label>
|
||
<input type="text" class="form-control" id="username" name="username" required
|
||
placeholder="4-20位字母、数字或下划线">
|
||
<small class="form-text text-muted">请输入4-20位的字母、数字或下划线</small>
|
||
</div>
|
||
<div class="mb-3">
|
||
<label for="password" class="form-label">
|
||
<i class="fas fa-lock me-1 text-muted"></i>密码
|
||
</label>
|
||
<input type="password" class="form-control" id="password" name="password" required
|
||
placeholder="至少8位字符">
|
||
<small class="form-text text-muted">至少8位字符,包含字母和数字</small>
|
||
</div>
|
||
<div class="mb-3">
|
||
<label for="confirm_password" class="form-label">
|
||
<i class="fas fa-lock me-1 text-muted"></i>确认密码
|
||
</label>
|
||
<input type="password" class="form-control" id="confirm_password" name="confirm_password" required
|
||
placeholder="再次输入密码">
|
||
</div>
|
||
<div class="mb-3">
|
||
<label for="email" class="form-label">
|
||
<i class="fas fa-envelope me-1 text-muted"></i>邮箱(可选)
|
||
</label>
|
||
<input type="email" class="form-control" id="email" name="email"
|
||
placeholder="example@domain.com">
|
||
</div>
|
||
<div class="mb-4">
|
||
<label for="captcha" class="form-label">
|
||
<i class="fas fa-shield-alt me-1 text-muted"></i>验证码
|
||
</label>
|
||
<div class="input-group">
|
||
<input type="text" class="form-control" id="captcha" name="captcha" required
|
||
placeholder="请输入验证码">
|
||
<img src="{{ url_for('captcha') }}" id="captcha-image"
|
||
class="img-thumbnail bg-light"
|
||
style="cursor: pointer; width: 100px; height: 38px;"
|
||
onclick="refreshCaptcha()"
|
||
title="点击刷新验证码">
|
||
</div>
|
||
</div>
|
||
<div class="d-grid gap-2">
|
||
<button type="submit" class="btn btn-primary">
|
||
<i class="fas fa-user-plus me-1"></i> 注册
|
||
</button>
|
||
<a href="{{ url_for('login') }}" class="btn btn-link text-decoration-none">
|
||
已有账号?去登录
|
||
</a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
function refreshCaptcha() {
|
||
var captchaImage = document.getElementById('captcha-image');
|
||
captchaImage.src = "{{ url_for('captcha') }}?" + new Date().getTime();
|
||
}
|
||
</script>
|
||
{% endblock %} |