From 860e8569a5ec44566d6f4507404630e93d981dc0 Mon Sep 17 00:00:00 2001 From: luoweijian <1329394916@qq.com> Date: Tue, 7 Jul 2026 09:30:58 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ding/domain/service/impl/AuthDomainServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/project/ding/domain/service/impl/AuthDomainServiceImpl.java b/src/main/java/com/project/ding/domain/service/impl/AuthDomainServiceImpl.java index e2db61e..f9e90ce 100644 --- a/src/main/java/com/project/ding/domain/service/impl/AuthDomainServiceImpl.java +++ b/src/main/java/com/project/ding/domain/service/impl/AuthDomainServiceImpl.java @@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.stereotype.Service; import org.springframework.security.core.GrantedAuthority; @@ -92,7 +93,9 @@ public class AuthDomainServiceImpl implements AuthDomainService { if (Objects.nonNull(adminWhiteListEntity)) { roles.add("ROLE_ADMIN"); } - + if (adminWhiteListEntity.getAdminType() != null && adminWhiteListEntity.getAdminType() == 1) { + roles.add("ROLE_SUPER_ADMIN"); + } // 3. 生成 JWT String token = jwtUtils.createToken(user.getId(), roles);