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