Commit Graph

32 Commits

Author SHA1 Message Date
chengkai3 811b89bbb0 [fix]:[FL-196][补修 database.py init_db() 中残留的 atp_model 引用] 2026-06-27 17:56:13 +08:00
chengkai3 f3e5640290 fix:[FL-193][用户管理 - email 字段 NOT NULL 约束冲突]
修复 users.email 字段 NOT NULL 约束与前端可选表单不一致的问题。

## 改动内容

1. 添加数据库兼容性检查函数 `_ensure_user_email_nullable()`
   - 检测 users.email 字段是否有 NOT NULL 约束
   - 如果存在约束则自动移除,使字段变为可选
   - 仅对 PostgreSQL 数据库生效

2. 在 `init_db()` 中调用该函数
   - 确保应用启动时自动应用迁移
   - 与现有兼容性检查函数保持一致的模式

3. 添加单元测试 `test_user_email_optional.py`
   - 验证可以创建不带 email 的用户
   - 验证可以创建带 email 的用户
   - 验证直接使用 User 模型创建用户时 email 可为 None

## 修复方案

采用 Issue 中推荐的方案 1(数据库层面修复):
- 将 email 字段改为可选,与前端表单语义保持一致
- 用户可以选择不填写邮箱
- email 字段保持 UNIQUE 约束,但允许 NULL 值

## 相关文件

- api/app/core/database.py:523-546 - 新增兼容性检查函数
- api/app/core/database.py:586 - 在 init_db() 中调用
- api/tests/test_user_email_optional.py - 新增单元测试

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 11:34:22 +08:00
chengkai3 9ba1cc4388 [feat]:[FL-118][增加密码错误5次禁止登录半小时功能]
- 在User模型添加failed_login_attempts和failed_login_locked_until字段
- 在database.py添加字段迁移兼容性函数_ensure_user_login_lockout_column_compatibility
- 修改auth_service.py的login_user函数实现登录锁定逻辑:
  * 检查账户是否处于锁定状态
  * 密码错误时递增失败计数
  * 失败5次后锁定账户30分钟
  * 登录成功后重置失败计数和锁定状态
- 添加单元测试test_login_lockout.py验证功能

Co-authored-by: multica-agent <github@multica.ai>
2026-06-14 01:07:26 +08:00
chengkai3 fac37ddb8d [fix/feat]:[FL-81][ATP模型管理改造为资产发布制]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-11 22:39:48 +08:00
chengkai3 2ad2405cd3 [fix/feat]:[FL-74][高程数据支持DEM地形瓦片预览和线路地形图]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-10 00:26:09 +08:00
chengkai3 d36aeb8636 [feat]:[FL-65][新增定时任务管理页面]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-09 12:00:59 +08:00
chengkai3 4e2b3dcdad [fix]:[FL-57][统一计算任务到 Celery worker]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-09 08:29:10 +08:00
chengkai3 5a41cd4d3d [fix/feat]:[FL-42][清理题库 Markdown 导题 热搜遗留模块]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-08 12:48:12 +08:00
chengkai3 a6bb67752c [fix]:[FL-44][清理遗留聊天 / 模型注册模块]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-08 12:35:24 +08:00
chengkai3 dd8dd9244d [fix]:[FL-43][清理遗留需求协同待办日程JWT生成器模块]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-08 12:32:11 +08:00
chengkai3 4d7f67f73a [fix/feat]:[FL-39][移除 seed 启动自动调用,改为管理员手动接口触发]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-08 09:08:01 +08:00
chengkml 98f97bec01 feat: migrate tower profile professional fields 2026-06-06 22:16:09 +08:00
chengkml 578d124607 feat: add fl analysis backend skeleton 2026-06-06 20:56:44 +08:00
chengkai3 3c4ad99d63 feat(tower-models): add tower model management with legacy data seed 2026-05-03 18:15:54 +08:00
Admin 7c121b8948 优化高程数据管理交互并补充分析进度与文件明细能力
Co-authored-by: multica-agent <github@multica.ai>
2026-05-03 15:24:47 +08:00
Admin df7c6ca14e 完成高程数据集优化并支持多文件导入自动分析
Co-authored-by: multica-agent <github@multica.ai>
2026-05-03 13:42:51 +08:00
chengkai3 0019aa0fba feat: add scheduler and flower monitoring with worker registry 2026-05-01 21:05:42 +08:00
Admin 9e68a91941 下线诗词本等7项多余功能并清理相关代码
Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 19:43:49 +08:00
chengkai3 e5a33d7f9a feat: add elevation dataset management and line altitude apply jobs 2026-05-01 17:10:19 +08:00
Admin c051c2dbf8 修复 users 审计字段缺失导致 API 启动失败
Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 12:30:00 +08:00
Admin a2d32613ec 移除 users 审计人字段强制映射
Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 12:17:25 +08:00
Admin 7f2fafde5e 修复 users 审计字段映射并兼容旧列名
Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 12:11:36 +08:00
Admin 607512a1a4 修复 users 时间字段映射并兼容旧列名
Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 11:57:35 +08:00
chengkai3 fb1c3c8022 fix(api): add users pk column compatibility at startup 2026-05-01 08:54:24 +08:00
chengkai3 ba21ed8550 chore: sync workspace updates 2026-04-26 09:00:49 +08:00
chengkai3 db81bf41fc 前端框架修改 2026-04-26 00:14:25 +08:00
chengkai3 472234035d 前端框架修改 2026-04-23 09:41:54 +08:00
chengkai3 f99f1954f0 feat: add admin feature modules and page route mappings 2026-04-19 07:48:34 +08:00
chengkai3 a737e5f542 chore: sync workspace changes 2026-04-17 21:55:27 +08:00
chengkai3 1e3478265c feat(files): complete phase-1 file management flow 2026-04-12 20:48:23 +08:00
chengkai3 c777d9d32a feat: sync workspace updates 2026-04-12 16:00:20 +08:00
chengkai3 0eb656aaf2 feat: add CI/CD workflow and sync latest workspace changes 2026-04-12 00:03:30 +08:00