Browse Source

转发IRS 刷新密钥

master
PoffyZhang 1 year ago
parent
commit
9c455e689b
4 changed files with 7 additions and 9 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java
  2. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java
  3. +1
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/ProjectIrsManage.java
  4. +2
    -2
      pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java View File

@@ -206,7 +206,7 @@ public class DingInfoPullController {
String baseProjSysCode = "A331123467587202307014177";
String baseProjName = "遂昌县-nsl-项目测试004";
String baseProjId = "331123230130123412186";
String requestSecret = RefreshKeyUtil.getRequestSecret(appKey, appScret);
String requestSecret = RefreshKeyUtil.getRequestSecret(appKey, appScret,timestamp);
String capCode = CryptUtils.encryptHMAC(timestamp + areaCode,"bcb4fc0f517fc168ee543fcf4d231f3b");
String capTime = String.valueOf(timestamp);
String sign = CryptUtils.MD5Encode(appKey + requestSecret + timestamp);


+ 3
- 3
pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java View File

@@ -134,7 +134,7 @@ public class AppIrsManage {
long timestamp = System.currentTimeMillis();
String areaCode = project.getAreaCode();
String projectName = project.getProjectName();
String requestSecret = RefreshKeyUtil.getRequestSecret(pushAppKey, pushAppScret);
String requestSecret = RefreshKeyUtil.getRequestSecret(pushAppKey, pushAppScret,timestamp);
String capCode = CryptUtils.encryptHMAC(timestamp + areaCode, "bcb4fc0f517fc168ee543fcf4d231f3b");
String capTime = String.valueOf(timestamp);
String sign = CryptUtils.MD5Encode(pushAppKey + requestSecret + timestamp);
@@ -195,7 +195,7 @@ public class AppIrsManage {
public JSONObject searchApp(ApiApplyDTO apply) throws NoSuchAlgorithmException {
long timestamp = System.currentTimeMillis();
String appCode = apply.getAppId();
String requestSecret = RefreshKeyUtil.getRequestSecret(searchAppKey, searchAppScret);
String requestSecret = RefreshKeyUtil.getRequestSecret(searchAppKey, searchAppScret,timestamp);
String sign = CryptUtils.MD5Encode(searchAppKey + requestSecret + timestamp);
String url = searchUrl + "?requestTime=" + timestamp + "&sign=" + sign +
"&appKey=" + searchAppKey + "&" +
@@ -231,7 +231,7 @@ public class AppIrsManage {
long timestamp = System.currentTimeMillis();
String areaCode = StringUtils.isNotBlank(apply.getAreaCode()) ?
convertAreaCode(apply.getAreaCode()) : null;
String requestSecret = RefreshKeyUtil.getRequestSecret(searchAppKey, searchAppScret);
String requestSecret = RefreshKeyUtil.getRequestSecret(searchAppKey, searchAppScret,timestamp);
String sign = CryptUtils.MD5Encode(searchAppKey + requestSecret + timestamp);
String url = searchUrl + "?requestTime=" + timestamp + "&sign=" + sign +
"&appKey=" + searchAppKey + "&pageSize=1000&" +


+ 1
- 3
pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/ProjectIrsManage.java View File

@@ -1,6 +1,5 @@
package com.ningdatech.pmapi.irs.manage;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ningdatech.irs.service.IRefreshTokenService;
import com.ningdatech.pmapi.common.util.CryptUtils;
@@ -10,7 +9,6 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.stereotype.Component;
@@ -58,7 +56,7 @@ public class ProjectIrsManage {
*/
public JSONObject searchCoreBiz(String businessName,String orgCode,Integer limit,Integer page) {
long timestamp = System.currentTimeMillis();
String secret = RefreshKeyUtil.getRequestSecret(appKey, appSecret);
String secret = RefreshKeyUtil.getRequestSecret(appKey, appSecret,timestamp);
String sign = null;
try{
sign = CryptUtils.MD5Encode(appKey + secret + timestamp);


+ 2
- 2
pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest.java View File

@@ -78,7 +78,7 @@ public class IrsTest extends AppTests {
String appKey = "A331101453557202109017383";
String appCode = "A331123467587202307014177";//A331123467587202307014171

String requestSecret = RefreshKeyUtil.getRequestSecret(appKey, appScret);
String requestSecret = RefreshKeyUtil.getRequestSecret(appKey, appScret,timestamp);
String sign = CryptUtils.MD5Encode(appKey + requestSecret + timestamp);
String url = "https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm?" +
"requestTime=" + timestamp + "&sign=" + sign + "&appKey=" + appKey + "&name=&" +
@@ -99,7 +99,7 @@ public class IrsTest extends AppTests {
String baseProjSysCode = "A331123467587202307014177";
String baseProjName = "遂昌县-nsl-项目测试004";
String baseProjId = "331123230130123412186";
String requestSecret = RefreshKeyUtil.getRequestSecret(appKey, appScret);
String requestSecret = RefreshKeyUtil.getRequestSecret(appKey, appScret,timestamp);
String capCode = CryptUtils.MD5Encode(timestamp + areaCode);
String capTime = String.valueOf(timestamp);
String sign = CryptUtils.MD5Encode(appKey + requestSecret + timestamp);


Loading…
Cancel
Save