From ef083d9cd069f5d7142edd01b1828fb31090a01f Mon Sep 17 00:00:00 2001 From: rustdreamer Date: Wed, 8 May 2024 09:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/auth/auth.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index 52aa41d..f702f48 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -97,7 +97,7 @@ export class AuthService { const user_permissions_key = `user_permissions:${user.id}`; let user_permissions = [user.role] const role = await this.roleRepository.findOne({ where: { name: user.role } }) - if (role) { + if (role && role.permissions) { user_permissions = [...user_permissions, ...role.permissions.split('、')] } redis.set(