|
|
@ -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(); |
|
|
|
} |
|
|
|
} |
|
|
|