feat: 完成管理员密码登录修复和项目清理

- 修复BCryptPasswordEncoder密码验证问题
- 实现密码设置提示弹窗功能(仅对无密码用户显示一次)
- 优化修改密码逻辑和验证流程
- 更新Welcome页面背景样式
- 清理临时SQL文件和测试代码
- 移动数据库备份文件到database/backups目录
- 删除不必要的MD文档和临时文件
This commit is contained in:
AIGC Developer
2025-11-21 16:10:00 +08:00
parent 2961d2b0d0
commit dbd06435cb
384 changed files with 8064 additions and 5080 deletions

View File

@@ -37,3 +37,16 @@ springdoc.swagger-ui.display-request-duration=true
springdoc.swagger-ui.doc-expansion=none
springdoc.swagger-ui.default-models-expand-depth=1
springdoc.swagger-ui.default-model-expand-depth=1
# 腾讯云COS对象存储配置
# 是否启用COS设置为true后需要配置下面的参数
tencent.cos.enabled=false
# 腾讯云SecretId从控制台获取https://console.cloud.tencent.com/cam/capi
tencent.cos.secret-id=
# 腾讯云SecretKey
tencent.cos.secret-key=
# COS区域例如ap-guangzhou、ap-shanghai、ap-beijing等
tencent.cos.region=ap-guangzhou
# COS存储桶名称例如my-bucket-1234567890
tencent.cos.bucket-name=

View File

@@ -0,0 +1,10 @@
-- 添加最后活跃时间字段用于统计在线用户
ALTER TABLE users ADD COLUMN IF NOT EXISTS last_active_time TIMESTAMP NULL;
-- 为已存在的用户设置初始活跃时间(使用最后登录时间或创建时间)
UPDATE users
SET last_active_time = COALESCE(last_login_at, created_at)
WHERE last_active_time IS NULL;
-- 添加索引以提高查询效率
CREATE INDEX IF NOT EXISTS idx_users_last_active_time ON users(last_active_time);

View File

@@ -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>