add radis
This commit is contained in:
parent
dc48548db3
commit
8546044fdc
1 changed files with 53 additions and 53 deletions
|
|
@ -28,9 +28,9 @@ export class PermissionController extends Controller {
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
});
|
});
|
||||||
|
const formattedData = null;
|
||||||
await Promise.all([
|
// await Promise.all([
|
||||||
await redisClient.get(request.user.sub, async (err: any, reply: any) => {
|
return redisClient.get(request.user.sub, async (err: any, reply: any) => {
|
||||||
if (reply != null) {
|
if (reply != null) {
|
||||||
return new HttpSuccess(JSON.parse(reply));
|
return new HttpSuccess(JSON.parse(reply));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -51,7 +51,7 @@ export class PermissionController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDetail = await this.authRoleRepo.findOne({
|
const getDetail = await this.authRoleRepo.findOne({
|
||||||
select: ["roleName", "roleDescription"],
|
select: ["id", "roleName", "roleDescription"],
|
||||||
where: { id: posMaster.authRoleId },
|
where: { id: posMaster.authRoleId },
|
||||||
});
|
});
|
||||||
if (!getDetail) {
|
if (!getDetail) {
|
||||||
|
|
@ -80,7 +80,7 @@ export class PermissionController extends Controller {
|
||||||
redisClient.setex(request.user.sub, 20, JSON.stringify(formattedData));
|
redisClient.setex(request.user.sub, 20, JSON.stringify(formattedData));
|
||||||
return new HttpSuccess(formattedData);
|
return new HttpSuccess(formattedData);
|
||||||
}
|
}
|
||||||
}),
|
});
|
||||||
]);
|
// ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue