|
@@ -47,7 +47,7 @@ public class BaiduClient {
|
|
|
|
|
|
private static String apiKey;
|
|
|
|
|
|
- private static String apiSecret;
|
|
|
+ private static String secretKey;
|
|
|
|
|
|
private BaiduClient() {
|
|
|
}
|
|
@@ -83,13 +83,13 @@ public class BaiduClient {
|
|
|
.setSocketTimeout(10000).setConnectTimeout(10000).build();
|
|
|
|
|
|
apiKey = PropertyHolder.getString("$baidu.apiKey");
|
|
|
- apiSecret = PropertyHolder.getString("$baidu.apiSecret");
|
|
|
+ secretKey = PropertyHolder.getString("$baidu.secretKey");
|
|
|
|
|
|
if (StringUtils.isBlank(apiKey)) {
|
|
|
log.error("'facepp.apiKey' is not configured");
|
|
|
}
|
|
|
- if (StringUtils.isBlank(apiSecret)) {
|
|
|
- log.error("'facepp.apiSecret' is not configured");
|
|
|
+ if (StringUtils.isBlank(secretKey)) {
|
|
|
+ log.error("'facepp.secretKey' is not configured");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -102,7 +102,7 @@ public class BaiduClient {
|
|
|
public String getAccessToken() {
|
|
|
|
|
|
String url = "https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id="
|
|
|
- + apiKey + "&client_secret=" + apiSecret;
|
|
|
+ + apiKey + "&client_secret=" + secretKey;
|
|
|
HttpPost httpPost = new HttpPost(url);
|
|
|
httpPost.setConfig(BaiduClient.requestConfig);
|
|
|
|