fix: redis issue in user management

This commit is contained in:
Feng Yue
2025-08-13 15:33:25 +08:00
parent 1ad720304c
commit 39c6e3146c
2 changed files with 36 additions and 7 deletions

View File

@@ -1294,6 +1294,32 @@ class RedisClient {
return 0
}
}
// 🔧 Basic Redis operations wrapper methods for convenience
async get(key) {
const client = this.getClientSafe()
return await client.get(key)
}
async set(key, value, ...args) {
const client = this.getClientSafe()
return await client.set(key, value, ...args)
}
async setex(key, ttl, value) {
const client = this.getClientSafe()
return await client.setex(key, ttl, value)
}
async del(...keys) {
const client = this.getClientSafe()
return await client.del(...keys)
}
async keys(pattern) {
const client = this.getClientSafe()
return await client.keys(pattern)
}
}
const redisClient = new RedisClient()