| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>AI智能教学系统 - 注册</title>
- <style>
- :root {
- --primary-color: #4a90e2;
- --bg-color: #f0f2f5;
- --card-bg: #ffffff;
- }
- body {
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
- background-color: var(--bg-color);
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100vh;
- margin: 0;
- }
- .container {
- background-color: var(--card-bg);
- padding: 40px;
- border-radius: 10px;
- box-shadow: 0 4px 15px rgba(0,0,0,0.1);
- width: 350px;
- text-align: center;
- }
- h2 {
- color: #333;
- margin-bottom: 20px;
- }
- .form-group {
- margin-bottom: 15px;
- text-align: left;
- }
- label {
- display: block;
- margin-bottom: 5px;
- color: #666;
- }
- input[type="text"], input[type="password"] {
- width: 100%;
- padding: 10px;
- border: 1px solid #ddd;
- border-radius: 5px;
- box-sizing: border-box;
- }
- button {
- width: 100%;
- padding: 10px;
- background-color: var(--primary-color);
- color: white;
- border: none;
- border-radius: 5px;
- cursor: pointer;
- font-size: 16px;
- transition: background 0.3s;
- }
- button:hover {
- background-color: #357abd;
- }
- .links {
- margin-top: 15px;
- font-size: 14px;
- }
- .links a {
- color: var(--primary-color);
- text-decoration: none;
- }
- .links a:hover {
- text-decoration: underline;
- }
- /* 消息提示样式 */
- .alert {
- padding: 10px;
- margin-bottom: 15px;
- border-radius: 5px;
- font-size: 14px;
- }
- .alert-error { background-color: #f8d7da; color: #721c24; }
- .alert-success { background-color: #d4edda; color: #155724; }
- </style>
- </head>
- <body>
- <div class="container">
- <h2>创建新账号</h2>
- <!-- 显示Flash消息 -->
- {% with messages = get_flashed_messages(with_categories=true) %}
- {% if messages %}
- {% for category, message in messages %}
- <div class="alert alert-{{ category }}">{{ message }}</div>
- {% endfor %}
- {% endif %}
- {% endwith %}
- <form method="post" onsubmit="return validateForm()">
- <div class="form-group">
- <label for="username">用户名</label>
- <input type="text" id="username" name="username" required placeholder="设置用户名">
- </div>
- <div class="form-group">
- <label for="password">密码</label>
- <input type="password" id="password" name="password" required placeholder="设置密码">
- </div>
- <div class="form-group">
- <label for="confirm_password">确认密码</label>
- <input type="password" id="confirm_password" name="confirm_password" required placeholder="再次输入密码">
- </div>
- <button type="submit">注册</button>
- </form>
- <div class="links">
- 已有账号? <a href="{{ url_for('login') }}">去登录</a>
- </div>
- </div>
- <script>
- function validateForm() {
- var password = document.getElementById("password").value;
- var confirmPassword = document.getElementById("confirm_password").value;
- if (password !== confirmPassword) {
- alert("两次输入的密码不一致!");
- return false;
- }
- return true;
- }
- </script>
- </body>
- </html>
|