mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-14 03:02:49 +00:00
修复刷新权限问题
This commit is contained in:
parent
f9fa1fd5eb
commit
540d93e133
@ -36,6 +36,7 @@ export default {
|
|||||||
// port: 6379,
|
// port: 6379,
|
||||||
// password: '',
|
// password: '',
|
||||||
// db: 1,
|
// db: 1,
|
||||||
|
// ttl: null,
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// cool配置
|
// cool配置
|
||||||
|
|||||||
@ -33,16 +33,13 @@ export class BaseSysPermsService extends BaseService {
|
|||||||
async refreshPerms(userId) {
|
async refreshPerms(userId) {
|
||||||
const roleIds = await this.baseSysRoleService.getByUser(userId);
|
const roleIds = await this.baseSysRoleService.getByUser(userId);
|
||||||
const perms = await this.baseSysMenuService.getPerms(roleIds);
|
const perms = await this.baseSysMenuService.getPerms(roleIds);
|
||||||
await this.cacheManager.set(`admin:perms:${userId}`, JSON.stringify(perms));
|
await this.cacheManager.set(`admin:perms:${userId}`, perms);
|
||||||
// 更新部门权限
|
// 更新部门权限
|
||||||
const departments = await this.baseSysDepartmentService.getByRoleIds(
|
const departments = await this.baseSysDepartmentService.getByRoleIds(
|
||||||
roleIds,
|
roleIds,
|
||||||
this.ctx.admin.username === 'admin'
|
this.ctx.admin.username === 'admin'
|
||||||
);
|
);
|
||||||
await this.cacheManager.set(
|
await this.cacheManager.set(`admin:department:${userId}`, departments);
|
||||||
`admin:department:${userId}`,
|
|
||||||
JSON.stringify(departments)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user