|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.qiniu.util.Base64;
|
|
|
+import me.zhengjie.base.config.AppConfigInfo;
|
|
|
import me.zhengjie.base.util.baidu.Base64Util;
|
|
|
import me.zhengjie.base.util.baidu.FileUtil;
|
|
|
import me.zhengjie.base.util.baidu.HttpUtil;
|
|
|
@@ -20,10 +21,6 @@ public class BaiduServiceUtil {
|
|
|
|
|
|
private static final String AUTH_HOST = "https://aip.baidubce.com/oauth/2.0/token?";
|
|
|
|
|
|
- private static final String API_KEY = "OeKT7rg9AH0qPrfp8kulMzNu";
|
|
|
-
|
|
|
- private static final String SECRET_KEY = "GNcPCbtLPTDFzZIVPcC6IGSbfEkzXKNG";
|
|
|
-
|
|
|
// 请求url
|
|
|
private static final String HANDWRITING_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/handwriting";
|
|
|
|
|
|
@@ -76,9 +73,9 @@ public class BaiduServiceUtil {
|
|
|
// 1. grant_type为固定参数
|
|
|
+ "grant_type=client_credentials"
|
|
|
// 2. 官网获取的 API Key
|
|
|
- + "&client_id=" + API_KEY
|
|
|
+ + "&client_id=" + AppConfigInfo.BAIDU_API_KEY
|
|
|
// 3. 官网获取的 Secret Key
|
|
|
- + "&client_secret=" + SECRET_KEY;
|
|
|
+ + "&client_secret=" + AppConfigInfo.BAIDU_SECRET_KEY;
|
|
|
try {
|
|
|
URL realUrl = new URL(getAccessTokenUrl);
|
|
|
// 打开和URL之间的连接
|