liuyun 1790fb30a8 chore(openspec): archive close-phase-0, sync backend specs to main
- 归档 close-phase-0(RBAC 权限 + 审计/登录日志 + seed 收口)
- 新增主 spec:backend/auth、backend/res、backend/audit、backend/login
- 追踪 sysmgr-nest passwordHash 泄漏修复

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-10 23:23:56 +08:00

26 lines
941 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Login Log Specification
## Purpose
定义登录日志的自动落库行为:每次登录成功与失败均记录,失败附原因与来源信息。
## Requirements
### Requirement: 登录成功记录
系统 SHALL 在登录成功时写入 sys_login_log,记录 username、ip、user_agent、status=success。
#### Scenario: 登录成功
- **WHEN** 用户登录成功
- **THEN** 系统写入 login_log(username/ip/user_agent/status=success)
### Requirement: 登录失败记录
系统 SHALL 在登录失败时写入 sys_login_log,记录 username、ip、user_agent、status=fail 与失败原因 message。
#### Scenario: 密码错误
- **WHEN** 用户以错误密码登录失败
- **THEN** 系统写入 login_log,status=fail,message 说明密码错误
#### Scenario: 账号停用或锁定
- **WHEN** 停用或锁定账号尝试登录失败
- **THEN** 系统写入 login_log,status=fail,message 说明账号状态原因