From e03505135d9816c8b6ea67a91a7e1f493e662b6f Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期三, 12 三月 2025 14:53:08 +0800
Subject: [PATCH] 修改Client封装方式

---
 iailab-plat-sdk/src/main/java/com/iailab/sdk/util/http/IailabHttpUtils.java |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/iailab-plat-sdk/src/main/java/com/iailab/sdk/util/http/IailabHttpUtils.java b/iailab-plat-sdk/src/main/java/com/iailab/sdk/util/http/IailabHttpUtils.java
index f59f119..ad149fb 100644
--- a/iailab-plat-sdk/src/main/java/com/iailab/sdk/util/http/IailabHttpUtils.java
+++ b/iailab-plat-sdk/src/main/java/com/iailab/sdk/util/http/IailabHttpUtils.java
@@ -1,7 +1,7 @@
 package com.iailab.sdk.util.http;
 
 import com.iailab.sdk.auth.client.IailabAuthClient;
-import com.iailab.sdk.auth.config.AuthProperties;
+import com.iailab.sdk.auth.config.SdkAutoConfiguration;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.methods.HttpGet;
@@ -17,12 +17,6 @@
 
 
 public class IailabHttpUtils {
-
-    private static AuthProperties authProperties;
-
-    public static void setAuthProperties(AuthProperties properties) {
-        authProperties = properties;
-    }
 
     /**
      *
@@ -61,7 +55,7 @@
             httpGet.addHeader("Accept", "application/json");
             httpGet.addHeader("Content-Type", "application/json;charset=UTF-8");
             httpGet.addHeader("Authorization", "Bearer " + IailabAuthClient.accessToken);
-            httpGet.addHeader("Tenant-Id", String.valueOf(authProperties.getTenantId()));
+            httpGet.addHeader("Tenant-Id", SdkAutoConfiguration.TENANT_ID.toString());
             HttpResponse response = httpClient.execute(httpGet);
             if (response != null) {
                 HttpEntity resEntity = response.getEntity();
@@ -95,7 +89,7 @@
             httpPost.addHeader("Accept", "application/json");
             httpPost.addHeader("Content-Type", "application/json;charset=UTF-8");
             httpPost.addHeader("Authorization", "Bearer " + IailabAuthClient.accessToken);
-            httpPost.addHeader("Tenant-Id", String.valueOf(authProperties.getTenantId()));
+            httpPost.addHeader("Tenant-Id", SdkAutoConfiguration.TENANT_ID.toString());
             StringEntity stringEntity = new StringEntity(json);
             stringEntity.setContentEncoding("UTF-8");
             stringEntity.setContentType("application/json");

--
Gitblit v1.9.3