feat: 完成管理员密码登录修复和项目清理
- 修复BCryptPasswordEncoder密码验证问题 - 实现密码设置提示弹窗功能(仅对无密码用户显示一次) - 优化修改密码逻辑和验证流程 - 更新Welcome页面背景样式 - 清理临时SQL文件和测试代码 - 移动数据库备份文件到database/backups目录 - 删除不必要的MD文档和临时文件
This commit is contained in:
@@ -179,10 +179,10 @@
|
||||
|
||||
<form th:action="@{/login}" method="post" id="loginForm">
|
||||
<div class="form-floating">
|
||||
<input type="text" class="form-control" id="username" name="username"
|
||||
placeholder="用户名" required autocomplete="username">
|
||||
<label for="username">
|
||||
<i class="fas fa-user me-2"></i>用户名
|
||||
<input type="email" class="form-control" id="email" name="email"
|
||||
placeholder="邮箱" required autocomplete="email">
|
||||
<label for="email">
|
||||
<i class="fas fa-envelope me-2"></i>邮箱
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -225,8 +225,8 @@
|
||||
<div class="demo-info">
|
||||
<i class="fas fa-info-circle me-2"></i>
|
||||
<strong>演示账户:</strong><br>
|
||||
用户名: demo, 密码: demo<br>
|
||||
用户名: admin, 密码: admin
|
||||
请使用注册时的邮箱登录<br>
|
||||
或使用演示邮箱(如已配置)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -276,12 +276,20 @@
|
||||
|
||||
// Form validation
|
||||
document.getElementById('loginForm').addEventListener('submit', function(e) {
|
||||
const username = document.getElementById('username').value.trim();
|
||||
const email = document.getElementById('email').value.trim();
|
||||
const password = document.getElementById('password').value.trim();
|
||||
|
||||
if (!username || !password) {
|
||||
if (!email || !password) {
|
||||
e.preventDefault();
|
||||
alert('请填写用户名和密码');
|
||||
alert('请填写邮箱和密码');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证邮箱格式
|
||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
if (!emailRegex.test(email)) {
|
||||
e.preventDefault();
|
||||
alert('请输入有效的邮箱地址');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@@ -289,4 +297,3 @@
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user