From e775dfbdf46699d2046e35d4bbe4a4bbcd831fb3 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Wed, 15 Oct 2025 09:14:32 +0800
Subject: [PATCH] 1.重新修改system文件相关分类,按功能模块分文件夹。

---
 ard-work/src/main/java/com/ard/work/component/forest/TokenInterceptor.java |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/ard-work/src/main/java/com/ard/work/component/forest/TokenInterceptor.java b/ard-work/src/main/java/com/ard/work/component/forest/TokenInterceptor.java
index 72318db..207fbce 100644
--- a/ard-work/src/main/java/com/ard/work/component/forest/TokenInterceptor.java
+++ b/ard-work/src/main/java/com/ard/work/component/forest/TokenInterceptor.java
@@ -1,7 +1,7 @@
 package com.ard.work.component.forest;
 
-import com.ard.work.config.TyConfiguration;
 import com.ard.work.domain.receiver.AccessTokenReceiver;
+import com.ard.work.service.IArdServerInfoService;
 import com.dtflys.forest.http.ForestRequest;
 import com.dtflys.forest.interceptor.Interceptor;
 import lombok.extern.slf4j.Slf4j;
@@ -12,7 +12,7 @@
 @Slf4j
 public class TokenInterceptor<T> implements Interceptor<T> {
     @Resource
-    private TyConfiguration tyConfiguration;
+    private IArdServerInfoService ardServerService;
 
     /**
      * 该方法在请求发送之前被调用, 若返回false则不会继续发送请求
@@ -21,14 +21,11 @@
      */
     @Override
     public boolean beforeExecute(ForestRequest req) {
-        log.info("invoke Simple beforeExecute");
-        // 执行在发送请求之前处理的代码
-        // 从缓存里获取token
-        AccessTokenReceiver accessToken = tyConfiguration.getAccessToken();
+        log.debug("invoke Simple beforeExecute");
+        String serverId = (String) req.getVariableValue("serverId");
+        AccessTokenReceiver accessToken = ardServerService.getAccessToken(serverId);
         req.addHeader("x-cid", accessToken.getCompanyId());
         req.addHeader("x-token", accessToken.getAccessToken());
-        // req.addHeader("Authorization", ""));  // 添加Header
-        // req.addQuery("username", "foo");  // 添加URL的Query参数
         return true;  // 继续执行请求返回true
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3