|
|
|
@ -36,6 +36,7 @@ import org.apache.commons.httpclient.methods.PostMethod; |
|
|
|
|
import org.apache.commons.httpclient.methods.RequestEntity; |
|
|
|
|
import org.apache.commons.httpclient.methods.StringRequestEntity; |
|
|
|
|
import org.apache.commons.httpclient.params.HttpMethodParams; |
|
|
|
|
import org.springframework.core.env.Environment; |
|
|
|
|
import sun.misc.BASE64Encoder; |
|
|
|
|
|
|
|
|
|
import javax.crypto.Mac; |
|
|
|
@ -59,6 +60,15 @@ import java.util.concurrent.TimeUnit; |
|
|
|
|
@Slf4j |
|
|
|
|
public class ElephantUtils { |
|
|
|
|
|
|
|
|
|
// 大象V6地址
|
|
|
|
|
private static String ELE_V6_URL; |
|
|
|
|
|
|
|
|
|
static { |
|
|
|
|
Environment environment = SpringUtils.getBean(Environment.class); |
|
|
|
|
ELE_V6_URL = environment.getProperty("ele_v6_url"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static AjaxResult sendRequest(String uri, JSON data, Companyservice companyservice, Boolean useEleCloudUrl) { |
|
|
|
|
ISysConfigService configService = SpringUtils.getBean(ISysConfigService.class); |
|
|
|
|
|
|
|
|
@ -283,10 +293,12 @@ public class ElephantUtils { |
|
|
|
|
// url = ElephantConstants.DEV_TOKEN_HOST;
|
|
|
|
|
// }
|
|
|
|
|
// TODO 20231109 地址改成了京东云
|
|
|
|
|
String url = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
/*String url = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
if (isDevMode) { |
|
|
|
|
url = ElephantConstants.DEV_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
String url = ELE_V6_URL; |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("appKey", appkey); |
|
|
|
@ -367,10 +379,12 @@ public class ElephantUtils { |
|
|
|
|
String str = JSONUtil.toJsonStr(data); |
|
|
|
|
boolean isDevMode = CommonUtils.isDevMode(); |
|
|
|
|
// 主机名(京东云地址)
|
|
|
|
|
String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
/*String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
if (isDevMode) { |
|
|
|
|
host = ElephantConstants.DEV_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
String host = ELE_V6_URL; |
|
|
|
|
// 最终接口地址
|
|
|
|
|
String url = host + uri; |
|
|
|
|
|
|
|
|
@ -449,10 +463,12 @@ public class ElephantUtils { |
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// TODO : 2023/11/09 大象接口迁京东云
|
|
|
|
|
String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
/*String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
if (isDevMode) { |
|
|
|
|
host = ElephantConstants.DEV_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
String host = ELE_V6_URL; |
|
|
|
|
|
|
|
|
|
//kk TODO : 2023/9/5 大象接口迁京东云
|
|
|
|
|
//https://js.ele12.com/
|
|
|
|
@ -666,10 +682,11 @@ public class ElephantUtils { |
|
|
|
|
String str = JSONUtil.toJsonStr(data); |
|
|
|
|
boolean isDevMode = CommonUtils.isDevMode(); |
|
|
|
|
// 主机名(京东云地址)
|
|
|
|
|
String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
/*String host = ElephantConstants.PROD_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
if (isDevMode) { |
|
|
|
|
host = ElephantConstants.DEV_HOST_LOCAL_V6_JingDongYun; |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
String host = ELE_V6_URL; |
|
|
|
|
// 最终接口地址
|
|
|
|
|
String url = host + uri; |
|
|
|
|
|
|
|
|
|