mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-10 16:12:50 +00:00
实时刷新用户权限
This commit is contained in:
parent
811ce8968e
commit
e2810c149e
@ -38,6 +38,7 @@ export class BaseSysPermsService extends BaseService {
|
||||
* @param userId 用户ID
|
||||
*/
|
||||
async refreshPerms(userId) {
|
||||
await this.midwayCache.del(`admin:token:${userId}`);
|
||||
const roleIds = await this.baseSysRoleService.getByUser(userId);
|
||||
const perms = await this.baseSysMenuService.getPerms(roleIds);
|
||||
await this.midwayCache.set(`admin:perms:${userId}`, perms);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user