实时刷新用户权限

This commit is contained in:
COOL 2025-08-13 11:18:19 +08:00
parent 811ce8968e
commit e2810c149e

View File

@ -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);