fix: LoginRecord 创建时显式传 geo 空字段,修复 MySQL 严格模式 IntegrityError
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m24s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m24s
MySQL 严格模式下 CharField 即使模型定义了 default='',CREATE 不传字段仍报错。 显式传入 geo_country/geo_province/geo_city/geo_source='' 解决。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cc8cfe60cf
commit
6a0311d599
@ -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)
|
||||
|
||||
|
||||
@ -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 归属地解析 + 异常检测(不阻塞登录)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user