ludc
2023-10-12 0cab15970c0203bbcc1a72e9ec19469d298380ab
Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/utils/TokenUtil.java
@@ -16,6 +16,7 @@
 */
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;
@@ -23,6 +24,7 @@
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;
@@ -54,6 +56,10 @@
   public final static String LICENSE = TokenConstant.LICENSE;
   public final static String LICENSE_NAME = TokenConstant.LICENSE_NAME;
   public final static String STRATEGYUPDATESTATUS = "strategyUpdateStatus";
   public final static String TENANTNAME = "tenantName";
   public final static String DEPTNAME = "deptName";
   public final static String EMAIL = "email";
   public final static String SECRETGRADE = "secretGrade";
   public final static String DEPT_HEADER_KEY = "Dept-Id";
   public final static String ROLE_HEADER_KEY = "Role-Id";
@@ -164,7 +170,7 @@
      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()) {