From 5ca67fa90adb2150f15fc8dc5b03020d38e34a0f Mon Sep 17 00:00:00 2001 From: luyan Date: Wed, 10 May 2023 10:07:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=B8=B8=E9=87=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/net/TCCCClientUtils.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java index 822d6cfe22..7fcff43282 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java @@ -21,12 +21,15 @@ public class TCCCClientUtils { private static String SECRETKEY = "ymRuDJI8mCRUUPFvQqCPQME0c2MbfaM2"; + private static String ENDPOINT ="ccc.ap-shanghai.tencentcloudapi.com"; + public static String getToken() { try { Credential cred = new Credential(SECRETID, SECRETKEY); // 实例化一个http选项,可选的,没有特殊需求可以跳过 + HttpProfile httpProfile = new HttpProfile(); - httpProfile.setEndpoint("ccc.ap-shanghai.tencentcloudapi.com"); + httpProfile.setEndpoint(ENDPOINT); // 实例化一个client选项,可选的,没有特殊需求可以跳过 ClientProfile clientProfile = new ClientProfile(); clientProfile.setHttpProfile(httpProfile); @@ -46,4 +49,8 @@ public class TCCCClientUtils { return e.toString(); } } + + public static void main(String[] args) { + getToken(); + } }