| | |
| | | */ |
| | | package com.vci.ubcs.auth.utils; |
| | | |
| | | import com.vci.ubcs.system.cache.NacosConfigCache; |
| | | import lombok.SneakyThrows; |
| | | import com.vci.ubcs.common.constant.TenantConstant; |
| | | import org.springblade.core.launch.constant.TokenConstant; |
| | |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.utils.*; |
| | | import com.vci.ubcs.system.entity.Tenant; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | | import org.springframework.security.oauth2.common.exceptions.UnapprovedClientAuthenticationException; |
| | | import org.springframework.security.oauth2.common.exceptions.UserDeniedAuthorizationException; |
| | |
| | | if (tenant == null || tenant.getId() == null) { |
| | | throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_NO_TENANT); |
| | | } |
| | | if (StringUtil.equalsIgnoreCase(tenant.getTenantId(), BladeConstant.ADMIN_TENANT_ID)) { |
| | | if (StringUtil.equalsIgnoreCase(tenant.getTenantId(), NacosConfigCache.getAdminUserInfo().getTenantId())) { |
| | | return false; |
| | | } |
| | | if (getTenantProperties().getLicense()) { |