Compare commits

...

2 Commits

Author SHA1 Message Date
fang a1e4af12b9 Merge remote-tracking branch 'origin/main' into main 2024-11-13 10:55:14 +08:00
fang ba1cc9d003 待办 2024-11-13 10:53:12 +08:00
1 changed files with 7 additions and 8 deletions
sys/shkd-sys-sys/src/main/java/shkd/sys/sys/midservice/utils

View File

@ -7,7 +7,6 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.bos.util.HttpClientUtils;
import kd.bos.util.StringUtils;
import kd.data.idi.util.HexUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -26,12 +25,12 @@ import java.util.Map;
*/
public class RequestClient {
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
private String protocal;//http
private String ip;// 域名
private String port;// 端口
private String clientKey;// 系统标识
private final String protocal;//http
private final String ip;// 域名
private final String port;// 端口
private final String clientKey;// 系统标识
// private String clientSecret_scict;// clientSecret-scict
private RequestClient() {
@ -88,10 +87,10 @@ public class RequestClient {
private Map<String, String> getHeaders() throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
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();
map.put("systemid", this.clientKey);
map.put("sign", md5Str);
/* map.put("sign", md5Str);*/
map.put("Content-Type", "application/x-www-form-urlencoded");
return map;
}