|
@@ -130,6 +130,9 @@ public class OCRUtil {
|
|
|
log.info("百度OCR返回结果:" + result);
|
|
|
final JSONObject jsonBody = new JSONObject(result);
|
|
|
final JSONArray jsonArray = jsonBody.getJSONArray("words_result");
|
|
|
+ if (jsonArray.size() <= 0) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
final Object words = jsonArray.getBean(0, Map.class).get("words");
|
|
|
return words.toString();
|
|
|
}
|