xiejun
2023-10-18 e40973680e8842a0797ca2e1cd45ec5e6bf0f3d8
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;
@@ -83,6 +85,7 @@
   public final static String PASSWORD_KEY = "password";
   public final static String GRANT_TYPE_KEY = "grant_type";
   public final static String REFRESH_TOKEN_KEY = "refresh_token";
   public final static String USER_LOCK = "当前登录用户已被停用,请联系管理解封账号。";
   private static BladeTenantProperties tenantProperties;
@@ -168,7 +171,7 @@
      if (tenant == null || tenant.getId() == null) {
         throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_NO_TENANT);
      }
      if (StringUtil.equalsIgnoreCase(tenant.getTenantId(), nacosConfigCache.getAdminUserInfo().getTenantId())) {
      if (StringUtil.equalsIgnoreCase(tenant.getTenantId(), NacosConfigCache.getAdminUserInfo().getTenantId())) {
         return false;
      }
      if (getTenantProperties().getLicense()) {