mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-08 16:08:23 +08:00
update 校验签名
This commit is contained in:
@@ -180,6 +180,10 @@ public class ThirdPartyBaseController extends BaseController {
|
|||||||
* verifySignature
|
* verifySignature
|
||||||
*/
|
*/
|
||||||
protected boolean verifySignature(CommonParamsDTO dto) {
|
protected boolean verifySignature(CommonParamsDTO dto) {
|
||||||
|
return this.verifySignature(dto, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean verifySignature(CommonParamsDTO dto, String signSecret) {
|
||||||
// 查询密钥
|
// 查询密钥
|
||||||
String operatorId = StringUtils.isNotBlank(dto.getOperatorID()) ? dto.getOperatorID() : dto.getPlatformID();
|
String operatorId = StringUtils.isNotBlank(dto.getOperatorID()) ? dto.getOperatorID() : dto.getPlatformID();
|
||||||
ThirdPartySecretInfoVO secretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
|
ThirdPartySecretInfoVO secretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
|
||||||
@@ -187,7 +191,9 @@ public class ThirdPartyBaseController extends BaseController {
|
|||||||
throw new BusinessException("1", "无此对接平台");
|
throw new BusinessException("1", "无此对接平台");
|
||||||
}
|
}
|
||||||
// 校验签名,使用响应方的密钥
|
// 校验签名,使用响应方的密钥
|
||||||
String signSecret = secretInfoVO.getOurSigSecret();
|
if (StringUtils.isBlank(signSecret)) {
|
||||||
|
signSecret = secretInfoVO.getTheirSigSecret();
|
||||||
|
}
|
||||||
Map<String, String> map = Maps.newLinkedHashMap();
|
Map<String, String> map = Maps.newLinkedHashMap();
|
||||||
String operatorID = dto.getOperatorID();
|
String operatorID = dto.getOperatorID();
|
||||||
if (StringUtils.isNotBlank(operatorID)) {
|
if (StringUtils.isNotBlank(operatorID)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user