ec-nest/.env.example
liuyun 7340658305 feat: enforce RBAC, audit/login logging, and seed script
收口 Phase 0 三处「声明未生效」:
- 三级鉴权落地:权限集存 Redis(key 前缀隔离多项目),@RequirePermissions 挂到全部受控接口,super_admin 角色绕过权限码与 data_scope
- 审计/登录日志自动落库:@AuditLog 装饰器 + 拦截器异步写入(写操作+登录登出),登录成功/失败均记 login_log(脱敏)
- seed 脚本:一键初始化租户 touyun/用户 touyun/超管 super_admin/全量资源树(48 资源全量授权)

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

26 lines
596 B
Plaintext
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.

# 复制为 .env 并按需修改
# 数据库(MySQL 8)
DATABASE_URL="mysql://root:Mysql.123@127.0.0.1:3306/sysmgr"
# 服务端口
PORT=3000
# JWT(生产务必替换 secret)
JWT_SECRET="dev-secret-change-me"
JWT_ACCESS_TTL="7200"
JWT_REFRESH_TTL="604800"
# 日志(详见 src/logging/logger.config.ts)
LOG_LEVEL="info"
LOG_PRETTY="true"
LOG_FILE_ENABLED="false"
LOG_FILE_PATH="logs/app.log"
# Redis(权限缓存;多 fork 项目共用一个实例时用 REDIS_KEY_PREFIX 隔离)
REDIS_HOST="127.0.0.1"
REDIS_PORT="6379"
REDIS_DB="0"
REDIS_PASSWORD=""
REDIS_KEY_PREFIX="sysmgr:"