潘志宝
2025-03-20 83791397b6857162b2eb01ab73e8ae3c8b41b419
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//package com.iailab.module.sdk.auth.interceptor;
//
//import org.springframework.http.HttpRequest;
//import org.springframework.http.client.ClientHttpRequestExecution;
//import org.springframework.http.client.ClientHttpRequestInterceptor;
//import org.springframework.http.client.ClientHttpResponse;
//
//import java.io.IOException;
//
//public class AuthInterceptor implements ClientHttpRequestInterceptor {
//
//    private final AuthTokenHolder tokenHolder;
//
//    public AuthInterceptor(AuthTokenHolder tokenHolder) {
//        this.tokenHolder = tokenHolder;
//    }
//
//    @Override
//    public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) {
//        if (tokenHolder.getToken() != null) {
//            request.getHeaders().setBearerAuth(tokenHolder.getToken());
//        }
//        return execution.execute(request, body);
//    }
//
//}