#1584 test
This commit is contained in:
parent
664f5153da
commit
055e24273d
2 changed files with 19 additions and 1 deletions
|
|
@ -65,7 +65,7 @@ export class PermissionProfileController extends Controller {
|
||||||
|
|
||||||
if (!request.user.role.includes("SUPER_ADMIN")) {
|
if (!request.user.role.includes("SUPER_ADMIN")) {
|
||||||
rootId =
|
rootId =
|
||||||
orgRevisionActive?.posMasters?.filter((x) => x.next_holderId == profile.id)[0]
|
orgRevisionActive?.posMasters?.filter((x) => x.current_holderId == profile.id)[0]
|
||||||
?.orgRootId || null;
|
?.orgRootId || null;
|
||||||
if (!rootId) return new HttpSuccess([]);
|
if (!rootId) return new HttpSuccess([]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1718,6 +1718,24 @@ async function clearMenuAndRoleCache(): Promise<void> {
|
||||||
await delAsync(...roleKeys);
|
await delAsync(...roleKeys);
|
||||||
console.log(`[AMQ] Cleared ${roleKeys.length} role cache keys`);
|
console.log(`[AMQ] Cleared ${roleKeys.length} role cache keys`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const posMasterKeys = await keysAsync("posMaster_*");
|
||||||
|
if (posMasterKeys.length > 0) {
|
||||||
|
await delAsync(...posMasterKeys);
|
||||||
|
console.log(`[AMQ] Cleared ${posMasterKeys.length} posMaster cache keys`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const userKeys = await keysAsync("user_*");
|
||||||
|
if (userKeys.length > 0) {
|
||||||
|
await delAsync(...userKeys);
|
||||||
|
console.log(`[AMQ] Cleared ${userKeys.length} user cache keys`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const orgKeys = await keysAsync("org_*");
|
||||||
|
if (orgKeys.length > 0) {
|
||||||
|
await delAsync(...orgKeys);
|
||||||
|
console.log(`[AMQ] Cleared ${orgKeys.length} org cache keys`);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
redisClient.quit();
|
redisClient.quit();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue