refactor(auth): 重构认证模块适配Bootstrap 5样式 feat(controller): 在登录响应中返回用户对象 feat(server): 添加学生个人中心路由 refactor(models): 重构学生和成绩模型结构 style: 更新登录和注册页面UI设计 chore: 添加数据库备份脚本和空备份文件
187 lines
6.5 KiB
HTML
187 lines
6.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>注册 - 学生成绩管理系统</title>
|
|
<!-- Bootstrap 5 CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<!-- Font Awesome -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<!-- Google Fonts -->
|
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
--secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
|
}
|
|
|
|
body {
|
|
font-family: 'Noto Sans SC', sans-serif;
|
|
background: #f4f7f9;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 40px 0;
|
|
}
|
|
|
|
.register-container {
|
|
width: 100%;
|
|
max-width: 500px;
|
|
padding: 20px;
|
|
}
|
|
|
|
.card {
|
|
border: none;
|
|
border-radius: 1.5rem;
|
|
box-shadow: 0 15px 35px rgba(0,0,0,0.1);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.card-header {
|
|
background: var(--primary-gradient);
|
|
padding: 2rem;
|
|
text-align: center;
|
|
border: none;
|
|
}
|
|
|
|
.card-header h3 {
|
|
color: white;
|
|
font-weight: 700;
|
|
margin-bottom: 0.5rem;
|
|
letter-spacing: 1px;
|
|
}
|
|
|
|
.card-header p {
|
|
color: rgba(255,255,255,0.8);
|
|
margin-bottom: 0;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.card-body {
|
|
padding: 2rem 2.5rem;
|
|
}
|
|
|
|
.btn-register {
|
|
background: var(--primary-gradient);
|
|
border: none;
|
|
padding: 0.8rem;
|
|
font-weight: 600;
|
|
letter-spacing: 1px;
|
|
border-radius: 0.75rem;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.btn-register:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.auth-footer {
|
|
text-align: center;
|
|
margin-top: 1.5rem;
|
|
color: #6c757d;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.auth-footer a {
|
|
color: #764ba2;
|
|
text-decoration: none;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.auth-footer a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.input-group-text {
|
|
background-color: transparent;
|
|
border-right: none;
|
|
color: #adb5bd;
|
|
width: 45px;
|
|
justify-content: center;
|
|
}
|
|
|
|
.form-control, .form-select {
|
|
border-left: none;
|
|
}
|
|
|
|
.form-control:focus, .form-select:focus {
|
|
box-shadow: none;
|
|
border-color: #764ba2;
|
|
}
|
|
|
|
.form-control:focus + .input-group-text,
|
|
.input-group-text:focus-within {
|
|
border-color: #764ba2;
|
|
}
|
|
|
|
#classField {
|
|
transition: all 0.3s ease;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="register-container">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h3><i class="fas fa-user-plus me-2"></i>账号注册</h3>
|
|
<p>请填写以下信息完成注册</p>
|
|
</div>
|
|
<div class="card-body">
|
|
<form id="registerForm">
|
|
<div class="input-group mb-3">
|
|
<span class="input-group-text"><i class="fas fa-id-card"></i></span>
|
|
<input type="text" class="form-control" id="id" name="id" placeholder="学号/工号" required autocomplete="username">
|
|
</div>
|
|
|
|
<div class="input-group mb-3">
|
|
<span class="input-group-text"><i class="fas fa-user"></i></span>
|
|
<input type="text" class="form-control" id="name" name="name" placeholder="真实姓名" required>
|
|
</div>
|
|
|
|
<div class="input-group mb-3">
|
|
<span class="input-group-text"><i class="fas fa-lock"></i></span>
|
|
<input type="password" class="form-control" id="password" name="password" placeholder="设置密码" required autocomplete="new-password">
|
|
</div>
|
|
|
|
<div class="input-group mb-3">
|
|
<span class="input-group-text"><i class="fas fa-shield-alt"></i></span>
|
|
<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" placeholder="确认密码" required autocomplete="new-password">
|
|
</div>
|
|
|
|
<div class="input-group mb-3">
|
|
<span class="input-group-text"><i class="fas fa-user-tag"></i></span>
|
|
<select class="form-select" id="role" name="role" required>
|
|
<option value="" selected disabled>选择您的角色</option>
|
|
<option value="student">学生</option>
|
|
<option value="teacher">教师</option>
|
|
<option value="admin">管理员</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="input-group mb-4" id="classField" style="display: none;">
|
|
<span class="input-group-text"><i class="fas fa-users"></i></span>
|
|
<input type="text" class="form-control" id="class" name="class" placeholder="班级名称 (如: 2023级1班)">
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary w-100 btn-register mb-3" id="registerBtn">
|
|
<span class="spinner-border spinner-border-sm d-none me-2" role="status" aria-hidden="true"></span>
|
|
注 册
|
|
</button>
|
|
|
|
<div class="auth-footer">
|
|
已有账户? <a href="/login">立即登录</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Bootstrap 5 JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="/public/js/auth.js"></script>
|
|
</body>
|
|
</html> |