Browse Source

[深爱]科目基础资料对接测试

zxl 1 year ago
parent
commit
6843d29793
1 changed files with 5 additions and 8 deletions
  1. 5 8
      src/main/java/com/uas/eis/service/Impl/RequestSTKServiceImpl.java

+ 5 - 8
src/main/java/com/uas/eis/service/Impl/RequestSTKServiceImpl.java

@@ -283,13 +283,13 @@ public class RequestSTKServiceImpl implements RequestSTKService {
 
         log.info("STK,加密前参数:{}",JSONObject.toJSONString(dto));
 
-        //获取签名
-        String sign = getSign(dto);
-        log.info("STK,加密后的签名:"+sign);
-
         //时间戳
         String timestamp = Long.toString(System.currentTimeMillis());
 
+        //获取签名
+        String sign = getSign(dto,timestamp);
+        log.info("STK,加密后的签名:"+sign);
+
         Map<String,String> headerMap = new HashMap<>();
         headerMap.put("appid",STK_APP_ID);
         headerMap.put("timestamp",timestamp);
@@ -301,10 +301,7 @@ public class RequestSTKServiceImpl implements RequestSTKService {
     /**
      * 获取深投控加密参数
      * */
-    public String getSign(Object dto) throws Exception {
-
-        //时间戳
-        String timestamp = Long.toString(System.currentTimeMillis());
+    public String getSign(Object dto,String timestamp) throws Exception {
 
         /*String content = dto.toString();*/
         //加签方法的重要参数