Files

78 lines
3.5 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>验证双因素认证 (2FA)</title>
<link href="https://tailwind.gvsds.com" rel="stylesheet">
<link href="https://cdn.gvsds.com/font-awesome/css/all.min.css" rel="stylesheet" media="print" onload="this.media='all'">
</head>
<body class="bg-gray-100 min-h-screen">
<div class="container mx-auto px-4 py-8 max-w-2xl">
<header class="mb-8">
<h1 class="text-3xl font-bold text-gray-800">验证双因素认证 (2FA)</h1>
<p class="text-gray-600 mt-2">测试您的2FA设置是否正常工作</p>
</header>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="mb-6">
{% for category, message in messages %}
<div class="p-4 rounded-md {% if category == 'success' %}bg-green-100 text-green-800{% else %}bg-red-100 text-red-800{% endif %}">
{{ message }}
</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<div class="bg-white rounded-lg shadow-md p-6">
<div class="mb-6">
<p class="text-gray-700 mb-4">
请从您的认证应用(如Google Authenticator、Authy等)中获取6位验证码,
输入下方进行验证测试。
</p>
<form method="post">
<div class="mb-4">
<label for="token" class="block text-gray-700 mb-2">验证码</label>
<input type="text" id="token" name="token"
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="6位数字验证码" maxlength="6" required>
</div>
<div class="flex gap-4">
<button type="submit" class="bg-blue-600 text-white py-2 px-6 rounded-md hover:bg-blue-700 transition duration-200">
<i class="fas fa-check mr-2"></i>验证
</button>
<a href="{{ url_for('GERP.Setup2fa') }}" class="bg-gray-600 text-white py-2 px-6 rounded-md hover:bg-gray-700 transition duration-200">
<i class="fas fa-cog mr-2"></i>管理2FA设置
</a>
</div>
</form>
</div>
</div>
<div class="text-center mt-6">
<a href="/" class="text-blue-600 hover:text-blue-800 transition duration-200">
<i class="fas fa-home mr-1"></i>返回首页
</a>
</div>
</div>
<script>
// 自动聚焦到验证码输入框并限制只能输入数字
document.addEventListener('DOMContentLoaded', function() {
const tokenInput = document.getElementById('token');
if (tokenInput) {
tokenInput.focus();
tokenInput.addEventListener('input', function(e) {
this.value = this.value.replace(/[^0-9]/g, '');
});
}
});
</script>
</body>
</html>