diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java index 173457a..ea68acf 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java @@ -10,12 +10,14 @@ import com.ningdatech.pmapi.organization.manage.ProcDefManage; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.web.bind.annotation.*; import org.springframework.web.client.RestTemplate; +import javax.annotation.Resource; import java.security.NoSuchAlgorithmException; import java.util.Objects; @@ -39,7 +41,8 @@ public class DingInfoPullController { private final ProcDefManage procDefManage; - private final IRefreshTokenService refreshTokenService; + @Resource(name = "refreshToken") + private IRefreshTokenService refreshTokenService; @Value("${irs.interface-local-refresh.request-token-url}") private String requestTokenUrl; @@ -112,7 +115,7 @@ public class DingInfoPullController { String dataName = "大数据管理局"; String secret = refreshTokenService.refreshToken(appKey,appSecret,requestTokenUrl,refreshTokenUrl); - String sign = CryptUtils.MD5Encode(appKey + appSecret + timestamp); + String sign = CryptUtils.MD5Encode(appKey + secret + timestamp); HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); RestTemplate restTemplate; if(Objects.nonNull(factory)){ diff --git a/pmapi/src/main/resources/application-dev.yml b/pmapi/src/main/resources/application-dev.yml index 7ae68ce..a597353 100644 --- a/pmapi/src/main/resources/application-dev.yml +++ b/pmapi/src/main/resources/application-dev.yml @@ -224,8 +224,8 @@ irs: appScret: 496f0f2a19994f76b4fd9dae087366c7 appKey: A331101453557202109017383 interface-local-refresh: - request-token-url: https://interface.ls.local/a/api/requestTokenKey - refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey + request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} + refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} hostname: iZbp13nwyvib53j4j1p2xoZ login: diff --git a/pmapi/src/main/resources/application-pre.yml b/pmapi/src/main/resources/application-pre.yml index bb76850..42bf04f 100644 --- a/pmapi/src/main/resources/application-pre.yml +++ b/pmapi/src/main/resources/application-pre.yml @@ -227,8 +227,8 @@ irs: appScret: 496f0f2a19994f76b4fd9dae087366c7 appKey: A331101453557202109017383 interface-local-refresh: - request-token-url: https://interface.ls.local/a/api/requestTokenKey - refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey + request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} + refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} hostname: iZ6mx01asxnsmennpzoxooZ login: phone-verify-code: diff --git a/pmapi/src/main/resources/application-prod.yml b/pmapi/src/main/resources/application-prod.yml index 828a700..a9f7fcc 100644 --- a/pmapi/src/main/resources/application-prod.yml +++ b/pmapi/src/main/resources/application-prod.yml @@ -227,8 +227,8 @@ irs: appScret: 496f0f2a19994f76b4fd9dae087366c7 appKey: A331101453557202109017383 interface-local-refresh: - request-token-url: https://interface.ls.local/a/api/requestTokenKey - refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey + request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} + refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} hostname: iZ6mx01gyeodd80imxd2gbZ login: phone-verify-code: diff --git a/pmapi/src/test/resources/application-dev.yml b/pmapi/src/test/resources/application-dev.yml index c6effa5..bb0ba65 100644 --- a/pmapi/src/test/resources/application-dev.yml +++ b/pmapi/src/test/resources/application-dev.yml @@ -223,8 +223,8 @@ irs: appScret: 496f0f2a19994f76b4fd9dae087366c7 appKey: A331101453557202109017383 interface-local-refresh: - request-token-url: https://interface.ls.local/a/api/requestTokenKey - refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey + request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} + refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} hostname: iZbp13nwyvib53j4j1p2xoZ login: diff --git a/pmapi/src/test/resources/application-pre.yml b/pmapi/src/test/resources/application-pre.yml index bb76850..42bf04f 100644 --- a/pmapi/src/test/resources/application-pre.yml +++ b/pmapi/src/test/resources/application-pre.yml @@ -227,8 +227,8 @@ irs: appScret: 496f0f2a19994f76b4fd9dae087366c7 appKey: A331101453557202109017383 interface-local-refresh: - request-token-url: https://interface.ls.local/a/api/requestTokenKey - refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey + request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} + refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} hostname: iZ6mx01asxnsmennpzoxooZ login: phone-verify-code: diff --git a/pmapi/src/test/resources/application-prod.yml b/pmapi/src/test/resources/application-prod.yml index fb53797..f46298d 100644 --- a/pmapi/src/test/resources/application-prod.yml +++ b/pmapi/src/test/resources/application-prod.yml @@ -222,8 +222,8 @@ irs: appScret: 496f0f2a19994f76b4fd9dae087366c7 appKey: A331101453557202109017383 interface-local-refresh: - request-token-url: https://interface.ls.local/a/api/requestTokenKey - refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey + request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} + refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign} hostname: iZ6mx01gyeodd80imxd2gbZ login: phone-verify-code: