Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
ede21bb2f8
1 changed files with 47 additions and 47 deletions
|
|
@ -35,9 +35,9 @@ export class PermissionController extends Controller {
|
||||||
const getAsync = promisify(redisClient.get).bind(redisClient);
|
const getAsync = promisify(redisClient.get).bind(redisClient);
|
||||||
|
|
||||||
let reply = await getAsync("role_" + request.user.sub);
|
let reply = await getAsync("role_" + request.user.sub);
|
||||||
if (reply != null) {
|
// if (reply != null) {
|
||||||
reply = JSON.parse(reply);
|
// reply = JSON.parse(reply);
|
||||||
} else {
|
// } else {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
select: ["id"],
|
select: ["id"],
|
||||||
where: { keycloak: request.user.sub },
|
where: { keycloak: request.user.sub },
|
||||||
|
|
@ -81,8 +81,8 @@ export class PermissionController extends Controller {
|
||||||
...getDetail,
|
...getDetail,
|
||||||
roles: roleAttrData,
|
roles: roleAttrData,
|
||||||
};
|
};
|
||||||
redisClient.setex("role_" + request.user.sub, 86400, JSON.stringify(reply));
|
// redisClient.setex("role_" + request.user.sub, 86400, JSON.stringify(reply));
|
||||||
}
|
// }
|
||||||
return new HttpSuccess(reply);
|
return new HttpSuccess(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue