diff --git a/src/config/config.default.ts b/src/config/config.default.ts index e967ea9..ca6f266 100644 --- a/src/config/config.default.ts +++ b/src/config/config.default.ts @@ -36,6 +36,7 @@ export default { // port: 6379, // password: '', // db: 1, + // ttl: null, // }, // }, // cool配置 diff --git a/src/modules/base/service/sys/perms.ts b/src/modules/base/service/sys/perms.ts index 31716b9..db2adf2 100644 --- a/src/modules/base/service/sys/perms.ts +++ b/src/modules/base/service/sys/perms.ts @@ -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); } /**