feat(auth): 微信 session_key 迁移到 Redis — 内存降级兜底
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

session_key 从全局 HashMap 迁移到 Redis(SET key EX 300 / GETDEL),
Redis 不可用时自动降级到内存缓存,提升多实例部署安全性。
This commit is contained in:
iven
2026-04-27 13:05:25 +08:00
parent a4daa8f49c
commit 2519ad8fee
5 changed files with 85 additions and 36 deletions

View File

@@ -57,6 +57,7 @@ impl FromRef<AppState> for erp_auth::AuthState {
default_tenant_id: state.default_tenant_id,
wechat_appid: state.config.wechat.appid.clone(),
wechat_secret: state.config.wechat.secret.clone(),
redis: Some(state.redis.clone()),
}
}
}