Commit 7758a817 authored by 廖旭伟's avatar 廖旭伟

sign接口参数顺序修改

parent 566fcee9
...@@ -79,9 +79,7 @@ public class MidSignApiController { ...@@ -79,9 +79,7 @@ public class MidSignApiController {
if("post".equalsIgnoreCase(midReq.getMethod())){ if("post".equalsIgnoreCase(midReq.getMethod())){
headerMap.put("appId", appId); headerMap.put("appId", appId);
headerMap.put("appKey", appKey); headerMap.put("appKey", appKey);
JSONObject object1 = JSONObject.parseObject(midReq.getBody()); headerMap.put("body", midReq.getBody());
headerMap.put("body", object1.toJSONString());
String timeStamp = System.currentTimeMillis() + ""; String timeStamp = System.currentTimeMillis() + "";
headerMap.put("timeStamp", timeStamp); headerMap.put("timeStamp", timeStamp);
String nonce = RandomUtil.randomNumbers(6); String nonce = RandomUtil.randomNumbers(6);
...@@ -115,9 +113,7 @@ public class MidSignApiController { ...@@ -115,9 +113,7 @@ public class MidSignApiController {
}*/ }*/
String signStr = signSb.substring(0, signSb.length() - 1); String signStr = signSb.substring(0, signSb.length() - 1);
log.info("签名源字符串: " + signStr); log.info("签名源字符串: " + signStr);
// String sign = EncryptionUtils.SHA256(signStr); String sign = EncryptionUtils.SHA256(signStr);
Digester sha256 = new Digester(DigestAlgorithm.SHA256);
String sign = sha256.digestHex(signStr);
log.info("签名计算结果: " + sign); log.info("签名计算结果: " + sign);
signResp.setSign(sign); signResp.setSign(sign);
return Rest.ok(signResp); return Rest.ok(signResp);
...@@ -127,5 +123,4 @@ public class MidSignApiController { ...@@ -127,5 +123,4 @@ public class MidSignApiController {
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment