调整验签
This commit is contained in:
@@ -144,6 +144,10 @@ public enum ErrorCodeEnum {
|
||||
|
||||
TIME_FALSE(109002, "结束时间不能早于开始时间",null),
|
||||
|
||||
BUSINESS_ID_NOT_EXIST(109003, "kdzBusinessId解析异常,请检查",null),
|
||||
|
||||
VERIFY_MD5_FALSE(109004, "验签失败,请检查",null),
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class KdzApiServiceImpl implements KdzApiService {
|
||||
String kdzBusinessId = request.getKdzBusinessId();
|
||||
String lineId = splitMethod(kdzBusinessId);
|
||||
if (StringUtil.isBlank(lineId)){
|
||||
throw new ServiceException("kdzBusinessId解析异常,请检查");
|
||||
throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
|
||||
}
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId));
|
||||
if (Objects.isNull(lineInfoDO)){
|
||||
|
||||
@@ -31,7 +31,7 @@ public class KdzApiController {
|
||||
@RequestBody XfsgOpenApiRequest request) {
|
||||
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
|
||||
if(!verifyMD5(request,eid)){
|
||||
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
|
||||
}
|
||||
if(eid == null || request.getBizContent() == null){
|
||||
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
@@ -47,10 +47,7 @@ public class KdzApiController {
|
||||
sb.append("timestamp=").append(request.getTimestamp()).append("&");
|
||||
//企业唯一标识enterpriseId
|
||||
sb.append("enterpriseId=").append(eid).append("&");
|
||||
sb.append("bizContent=").append(request.getBizContent());
|
||||
|
||||
String md5 = EncryptUtil.xfsgMd5(sb.toString());
|
||||
|
||||
return md5.equals(request.getSign());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user