Enhance authentication logging and update MyBatis configuration

This commit is contained in:
zyh
2025-08-24 16:52:20 +08:00
parent 51d6319121
commit bc1f10381a
20 changed files with 122 additions and 36 deletions

View File

@@ -41,7 +41,7 @@
- 建议:后续改为 Flyway 迁移(`V001__init.sql` 起步),避免手工执行 SQL
## 安全与认证
- 登录:`POST /api/auth/login``userType=admin|agent` + `username` + `password`
- 登录:`POST /api/auth/login``username` + `password`,角色自动识别
- 自我信息:`GET /api/auth/me`Authorization: Bearer <JWT>
- JWTHS256配置在 `security.jwt.*``application.yml`
- 密码:默认 `BCrypt`;兼容 `PLAIN:` 前缀以便初始化迁移
@@ -103,7 +103,7 @@
- [ ] 乐观锁/并发扣点优化、观测/告警
## 接口清单(节选)
- `POST /api/auth/login`:登录获取 JWT
- `POST /api/auth/login`:登录获取 JWT(仅需 `username``password`
- `GET /api/auth/me`:当前用户信息
- `GET /api/link/{codeNo}`:查询链接元数据(待实现)
- `POST /api/link/{codeNo}/select-region`:选择区服(待实现)
@@ -119,4 +119,3 @@
- 默认管理员以 `PLAIN:` 存储密码,仅用于初始化。上线前必须改为 BCrypt
- 方案:使用项目内 `BCryptPasswordEncoder` 生成哈希,更新 `user_account.password_hash`
- 统一返回体与 RBAC 规则将在后续迭代落地