|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cloud.sa.flow.commom.common.Request;
|
|
|
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import org.apache.http.HttpEntity;
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
|
import org.apache.http.client.methods.HttpGet;
|
|
|
@@ -27,7 +28,7 @@ public class StHttpRequest {
|
|
|
entity.setContentType("application/json"); // 设置请求的内容类型
|
|
|
httpPost.setEntity(entity);
|
|
|
// 添加请求头
|
|
|
- httpPost.addHeader("eventId", "3988bfd0-67f0-11ef-9ea9-71058a057db9"); // 添加eventId请求头
|
|
|
+ httpPost.addHeader("X-Access-Token", StpUtil.getTokenValue()); // 添加eventId请求头
|
|
|
// 执行请求并获取响应
|
|
|
CloseableHttpResponse response = httpClient.execute(httpPost);
|
|
|
try {
|
|
|
@@ -51,7 +52,7 @@ public class StHttpRequest {
|
|
|
try {
|
|
|
HttpGet httpGet = new HttpGet(uri); // 替换为你的目标URL
|
|
|
// 添加请求头
|
|
|
- httpGet.addHeader("eventId", "3988bfd0-67f0-11ef-9ea9-71058a057db9"); // 添加eventId请求头
|
|
|
+ httpGet.addHeader("X-Access-Token", StpUtil.getTokenValue()); // 添加eventId请求头
|
|
|
// 执行请求并获取响应
|
|
|
CloseableHttpResponse response = httpClient.execute(httpGet);
|
|
|
try {
|