Commit Graph

45 Commits

Author SHA1 Message Date
chengkai3 6a653a4960 fix:[FL-220][菜单禁用访问控制]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-20 18:40:29 +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 a332ba58ba [fix]:[FL-190][系统接口中的stacktrace信息不要直接展示到页面给用户看]
- 后端:在 exception_handlers.py 添加文档注释,明确说明 stacktrace 字段仅供开发调试使用
- 前端:在 api.ts 添加 ApiErrorResponse 类型定义和文档注释,明确 readApiError 函数只提取 detail 字段展示给用户
- stacktrace 在 debug 模式下会返回给浏览器(可在开发者工具中查看),但前端不会展示到页面上

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 10:19:25 +08:00
chengkai3 3cc35c0336 feat: [FL-184] 添加调试模式配置以返回异常堆栈跟踪
- 在配置文件中添加 debug_mode 参数,默认值为 true
- 创建全局异常处理器,当 debug_mode 开启时返回 stacktrace 信息
- 在 .env.example 中添加 DEBUG_MODE 配置项说明
- 新增测试文件验证调试模式功能

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 08:39:21 +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 d7f712e3c1 [feat]:[FL-69][接入 legacy ATP/EGM worker 适配链路]
Co-authored-by: multica-agent <github@multica.ai>
2026-06-09 12:28:02 +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
Admin c4e3d06072 调整用户初始化数据为管理员账号
Co-authored-by: multica-agent <github@multica.ai>
2026-05-11 16:31:13 +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
Admin d7f05e36bf 修复worker监控页不显示与自动注册异常
Co-authored-by: multica-agent <github@multica.ai>
2026-05-03 13:16:24 +08:00
chengkai3 cf0a5c978e refactor: remove scheduler service and unify celery dispatch 2026-05-02 10:22:34 +08:00
chengkai3 04524d57dc chore: switch file storage default to minio and align deploy workflow 2026-05-01 21:49:45 +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
Admin 110fb79e60 修复用户状态列映射兼容问题
Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 11:39:17 +08:00
Admin 8c9699cd46 fix(api): support configurable users password column mapping
Co-authored-by: multica-agent <github@multica.ai>
2026-05-01 11:21:57 +08:00
chengkml c7b018b10a chore: switch default postgres host port to 5434 2026-05-01 10:49:29 +08:00
chengkml 4b8b6f7210 fix(api): support configurable users username column mapping 2026-05-01 10:18:13 +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 3fd15fbd21 前端框架修改 2026-04-24 15:50:52 +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 c2505eb70c fix: enhance cors origin configuration 2026-04-12 23:00:19 +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