mirror of
https://github.com/vastxie/99AI.git
synced 2025-11-12 11:43:42 +08:00
v3.5.0
This commit is contained in:
13
dist/modules/redisCache/redisCache.service.js
vendored
13
dist/modules/redisCache/redisCache.service.js
vendored
@@ -18,12 +18,6 @@ let RedisCacheService = class RedisCacheService {
|
||||
constructor(redisClient) {
|
||||
this.redisClient = redisClient;
|
||||
}
|
||||
async onModuleInit() {
|
||||
}
|
||||
test() {
|
||||
this.redisClient.set('aaa', 111);
|
||||
return 1;
|
||||
}
|
||||
async get(body) {
|
||||
const { key } = body;
|
||||
const res = await this.redisClient.get(key);
|
||||
@@ -40,6 +34,13 @@ let RedisCacheService = class RedisCacheService {
|
||||
throw new common_1.HttpException(error, common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
async getJwtSecret() {
|
||||
const secret = await this.redisClient.get('JWT_SECRET');
|
||||
if (!secret) {
|
||||
throw new Error('JWT secret not found in Redis');
|
||||
}
|
||||
return secret;
|
||||
}
|
||||
async ttl(key) {
|
||||
return await this.redisClient.ttl(key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user