diff --git a/CLAUDE.md b/CLAUDE.md index 8330835..233e5e2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -444,6 +444,7 @@ npx tsx src/index.ts --resume /Users/maidong/Desktop/zyc/研究openclaw/视频 | 2026-03-18 | v0.9.1: 系统设置页 — 异常检测总开关、R1-R5默认阈值、飞书接收人+测试、告警冷却 | Frontend | | 2026-03-18 | v0.9.1: 团队管理 — 预期登录城市(必填) + 自动学习 + disabled_by 来源标签 | Full stack | | 2026-03-18 | v0.9.1: 前端拦截器 — user_disabled/team_disabled 错误码处理,弹窗提示后跳登录 | Frontend | +| 2026-03-19 | fix: LoginRecord 创建时显式传 geo 空字段,修复 MySQL 严格模式 IntegrityError | Backend | ### Phase 4 Details (2026-03-13) diff --git a/backend/apps/accounts/views.py b/backend/apps/accounts/views.py index a3c9b47..3df05a4 100644 --- a/backend/apps/accounts/views.py +++ b/backend/apps/accounts/views.py @@ -103,6 +103,7 @@ def login_view(request): user_agent = request.META.get('HTTP_USER_AGENT', '') login_record = LoginRecord.objects.create( user=user, team=user.team, ip_address=ip, user_agent=user_agent, + geo_country='', geo_province='', geo_city='', geo_source='', ) # IP 归属地解析 + 异常检测(不阻塞登录)