certmanager/templates/login.html

64 lines
2.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-sign-in-alt text-primary me-2"></i>用户登录
</h4>
</div>
<div class="card-body">
<form method="POST" action="{{ url_for('login') }}">
<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="请输入用户名">
</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="请输入密码">
</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-sign-in-alt me-1"></i> 登录
</button>
<a href="{{ url_for('register') }}" 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 %}