This commit is contained in:
parent
9cc64cd648
commit
ba1cc9d003
|
@ -7,7 +7,6 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
import kd.bos.util.HttpClientUtils;
|
import kd.bos.util.HttpClientUtils;
|
||||||
import kd.bos.util.StringUtils;
|
import kd.bos.util.StringUtils;
|
||||||
import kd.data.idi.util.HexUtil;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -26,12 +25,12 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
public class RequestClient {
|
public class RequestClient {
|
||||||
private static RequestClient _instance;
|
private static RequestClient _instance;
|
||||||
private static Logger logger = LoggerFactory.getLogger(RequestClient.class);
|
private static final Logger logger = LoggerFactory.getLogger(RequestClient.class);
|
||||||
// application/x-www-form-urlencoded
|
// application/x-www-form-urlencoded
|
||||||
private String protocal;//http
|
private final String protocal;//http
|
||||||
private String ip;// 域名
|
private final String ip;// 域名
|
||||||
private String port;// 端口
|
private final String port;// 端口
|
||||||
private String clientKey;// 系统标识
|
private final String clientKey;// 系统标识
|
||||||
// private String clientSecret_scict;// clientSecret-scict
|
// private String clientSecret_scict;// clientSecret-scict
|
||||||
|
|
||||||
private RequestClient() {
|
private RequestClient() {
|
||||||
|
@ -88,10 +87,10 @@ public class RequestClient {
|
||||||
private Map<String, String> getHeaders() throws NoSuchAlgorithmException {
|
private Map<String, String> getHeaders() throws NoSuchAlgorithmException {
|
||||||
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||||
byte[] md5Bytes = md5.digest(this.clientKey.getBytes());
|
byte[] md5Bytes = md5.digest(this.clientKey.getBytes());
|
||||||
String md5Str = HexUtil.bytes2Hex(md5Bytes).toUpperCase();
|
/*String md5Str = HexUtil.bytes2Hex(md5Bytes).toUpperCase();*/
|
||||||
HashMap<String, String> map = new HashMap();
|
HashMap<String, String> map = new HashMap();
|
||||||
map.put("systemid", this.clientKey);
|
map.put("systemid", this.clientKey);
|
||||||
map.put("sign", md5Str);
|
/* map.put("sign", md5Str);*/
|
||||||
map.put("Content-Type", "application/x-www-form-urlencoded");
|
map.put("Content-Type", "application/x-www-form-urlencoded");
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue