From 424159f81a5493838bae97aa572965797c35f343 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期四, 12 十月 2023 15:36:36 +0800
Subject: [PATCH] 历史导入编码最大流水值不正确问题修复

---
 Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/utils/TokenUtil.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/utils/TokenUtil.java b/Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/utils/TokenUtil.java
index b24bd0b..2b7a3e2 100644
--- a/Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/utils/TokenUtil.java
+++ b/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;
@@ -85,6 +87,8 @@
 	public final static String REFRESH_TOKEN_KEY = "refresh_token";
 
 	private static BladeTenantProperties tenantProperties;
+	@Autowired
+	private static NacosConfigCache nacosConfigCache;
 
 	/**
 	 * 鑾峰彇绉熸埛閰嶇疆
@@ -168,7 +172,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()) {

--
Gitblit v1.9.3