wttwins
19ee7766e0
fix: ensure admin user role and isActive are restored on seed
Fixes #issue-number (管理员登录问题)
问题:
- v1.9.0 中 seed-admin.js 在更新已存在的管理员时,只更新了 educationStage 和 enrollmentYear
- 如果数据库迁移将 role 重置为 'user' 或 isActive 设为 false,管理员将无法登录
- 影响所有从旧版本升级到 v1.9.0 的用户
修复:
- 更新逻辑始终恢复 role='admin' 和 isActive=true
- 保留用户自定义的 educationStage/enrollmentYear(如果已设置)
- docker-entrypoint.sh 每次启动都运行 seed 确保权限正确
- 添加测试用例覆盖权限恢复场景
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-31 10:29:31 +00:00
..
2025-11-29 22:59:00 +08:00
2025-11-29 22:59:00 +08:00
2025-11-29 22:59:00 +08:00
2025-11-29 22:59:00 +08:00
2025-12-19 13:58:09 +08:00
2025-12-19 13:58:09 +08:00
2025-12-22 14:32:21 +08:00
2025-12-02 09:57:27 +08:00
2025-12-22 14:32:21 +08:00
2026-05-31 10:29:31 +00:00
2025-12-15 00:12:32 +08:00
2025-12-15 00:12:32 +08:00
2025-12-15 00:12:32 +08:00
2025-12-15 00:12:32 +08:00
2025-12-15 00:12:32 +08:00
2025-11-29 22:59:00 +08:00
2025-11-29 22:59:00 +08:00
2025-12-01 12:55:11 +08:00
2026-02-25 12:52:04 +08:00
2026-02-25 12:52:04 +08:00