wangxianzhang 3 years ago
parent
commit
2bbdc81cf8
  1. 10
      epmet-module/epmet-demo/epmet-demo-server/src/test/java/com/epmet/test/openapi/TestTakeTokenOpenApi.java

10
epmet-module/epmet-demo/epmet-demo-server/src/test/java/com/epmet/test/openapi/TestTakeTokenOpenApi.java

@ -20,9 +20,11 @@ import java.util.UUID;
*/
public class TestTakeTokenOpenApi {
String appId = "1504335474091569153";
// 这是测试环境的
//体悟实训的appId和secret
String appId = "61161d2f4b9c045859b7de5df93dd8b2";
String authType = "take_token";
String secret = "70e7ee0592d94affaa6e7b463926a3dd3cf1606945644baf810f93e8e9638c50";
String secret = "4d8e8fc9bacb41bba94e715f5fe2e0a36ae9c4150ade4436ad2c9448c486cc9c";
@Test
public void testIt() throws Exception {
@ -49,7 +51,7 @@ public class TestTakeTokenOpenApi {
String sign = OpenApiSignUtils.createSign(content, secret);
String takeTokenUrl = String.format("http://localhost:8080/api/epmet/ext/open-api/get-access-token?auth_type=%s&app_id=%s&timestamp=%s&sign=%s&nonce=%s", authType, appId, timestamp, sign, nonce);
String takeTokenUrl = String.format("https://epmet-dev.elinkservice.cn/api/epmet/ext/open-api/get-access-token?auth_type=%s&app_id=%s&timestamp=%s&sign=%s&nonce=%s", authType, appId, timestamp, sign, nonce);
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost(takeTokenUrl);
@ -83,7 +85,7 @@ public class TestTakeTokenOpenApi {
String sign = OpenApiSignUtils.createSign(createSignParams, secret);
String businessUrl = String.format("http://localhost:8080/api/epmet/ext/open-api/get-org-detail?auth_type=%s&app_id=%s&timestamp=%s&sign=%s&nonce=%s", authType, appId, timestamp, sign, nonce);
String businessUrl = String.format("https://epmet-dev.elinkservice.cn/api/epmet/ext/open-api/get-org-detail?auth_type=%s&app_id=%s&timestamp=%s&sign=%s&nonce=%s", authType, appId, timestamp, sign, nonce);
// 业务参数
JsonObject bizParam = new JsonObject();

Loading…
Cancel
Save