签名方式改造

release
zhenghaiyang@ele-cloud.com 2 years ago
parent 75bbddb51f
commit a73aca5c4c
  1. 1
      dxhy-core/src/main/java/com/dxhy/core/service/mailGather/impl/EmailMaintainServiceImpl.java
  2. 9
      dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java

@ -70,6 +70,7 @@ public class EmailMaintainServiceImpl implements EmailMaintainService {
*/
@Override
public boolean insert(EmailMaintainVo emailMaintain) {
DynamicContextHolder.push(DbConstant.BASICS_READ);
if(StringUtils.isEmpty(emailMaintain.getId())){
emailMaintain.setId(IdUtil.nanoId());
}

@ -106,6 +106,8 @@ public class InterfaceController extends AbstractController {
private IReceiptOutService iReceiptOutService;
@Resource
private VoucherRecordService voucherRecordService;
@Value("${erp.ipUrl}")
private String ipUrl;
/**
*
@ -149,7 +151,7 @@ public class InterfaceController extends AbstractController {
/**
* 鉴权
*/
result = authV5(request, dxhyInterfaceRequest,secretKey);
result = authV5( version+"/"+interfaceName, request, dxhyInterfaceRequest,secretKey);
long end1 = System.currentTimeMillis();
log.debug("{}鉴权耗时{}毫秒", LOGGER_MSG, end1 - begin1);
if (!ConfigurerInfo.SUCCSSCODE.equals(result.getCode())) {
@ -294,14 +296,15 @@ public class InterfaceController extends AbstractController {
return result;
}
private CheckResult authV5(HttpServletRequest request, DxhyInterfaceRequest dxhyInterfaceRequest,String secretKey) {
private CheckResult authV5(String url,HttpServletRequest request, DxhyInterfaceRequest dxhyInterfaceRequest,String secretKey) {
CheckResult checkResult = new CheckResult(RespStatusEnum.AUTHFAIL);
String reqUrl = request.getRequestURL().toString();
if (reqUrl.contains(ConfigureConstant.STRING_WH)) {
reqUrl = reqUrl.substring(ConfigureConstant.INT_0, reqUrl.indexOf(ConfigureConstant.STRING_WH));
}
log.debug("{}请求路径:{}", LOGGER_MSG, reqUrl);
//获取鉴权URL
String signUrl = getAuthUrl(reqUrl, request.getMethod());
String signUrl = ipUrl+url+"?";
TreeMap<String, String> sortMap = new TreeMap<>();
sortMap.put(ConfigurerInfo.SECRETID, dxhyInterfaceRequest.getSecretId());
sortMap.put(ConfigurerInfo.DATA_EXCHANGE_ID, dxhyInterfaceRequest.getDataExchangeId());

Loading…
Cancel
Save