feat: add redis

This commit is contained in:
2025-08-29 21:42:29 +08:00
parent af68d94efa
commit dc60a0a4bd
10 changed files with 875 additions and 52 deletions

View File

@ -1,10 +1,22 @@
RUST_LOG=info,udmin=debug
APP_ENV=development
APP_HOST=0.0.0.0
APP_PORT=9898
DB_URL=mysql://root:123456@127.0.0.1:3306/udmin
JWT_SECRET=please_change_me
# 数据库配置
DATABASE_URL=sqlite://udmin.db?mode=rwc
# JWT配置
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
JWT_ISS=udmin
JWT_ACCESS_EXP_SECS=1800
JWT_REFRESH_EXP_SECS=1209600
CORS_ALLOW_ORIGINS=http://localhost:5173
JWT_ACCESS_EXP_SECS=1800 # 30分钟
JWT_REFRESH_EXP_SECS=1209600 # 14天
# Redis配置
REDIS_URL=redis://:123456@127.0.0.1:6379/9
REDIS_TOKEN_VALIDATION=true # 是否启用Redis token验证
# 服务器配置
APP_HOST=0.0.0.0
APP_PORT=8080
# CORS配置
CORS_ALLOW_ORIGINS=http://localhost:5173
# 日志级别
RUST_LOG=info