|
@@ -51,17 +51,17 @@ public class AppletLoginController {
|
|
//https://api.weixin.qq.com/cv/ocr/idcard?type=MODE&img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
|
|
//https://api.weixin.qq.com/cv/ocr/idcard?type=MODE&img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
|
|
Map<String,String> map = new HashMap<>();
|
|
Map<String,String> map = new HashMap<>();
|
|
try {
|
|
try {
|
|
- String encode = URLEncoder.encode("http://118.178.139.79:5002/statics/2021/09/15/1631688213171.jpeg", "utf-8");
|
|
|
|
- map.put("img_url",encode);
|
|
|
|
|
|
+ String encode = URLEncoder.encode("http://118.178.139.79:5002/statics/2021/09/16/1631776710012.jpg", "utf-8");
|
|
|
|
+ map.put("img_url","http://118.178.139.79:5002/statics/2021/09/16/1631776710012.jpg");
|
|
map.put("access_token",accessToken);
|
|
map.put("access_token",accessToken);
|
|
- String s = HttpClientUtils.doPost("https://api.weixin.qq.com/cv/ocr/idcard?type=MODE&", map);
|
|
|
|
|
|
+ String s = HttpClientUtils.doPost("https://api.weixin.qq.com/cv/ocr/idcard?type=photo&img_url=http://118.178.139.79:5002/statics/2021/09/16/1631776710012.jpg" + "&access_token=" + accessToken,null);
|
|
System.out.println(s);
|
|
System.out.println(s);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- private String getAccessToken(){
|
|
|
|
|
|
+ private static String getAccessToken(){
|
|
String accessToken = "";
|
|
String accessToken = "";
|
|
try {
|
|
try {
|
|
accessToken = HttpClientUtils.doGet1("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxb9b83f3c86545690&secret=95adc6921a24a3c6cff55f2a1290f6f6");
|
|
accessToken = HttpClientUtils.doGet1("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxb9b83f3c86545690&secret=95adc6921a24a3c6cff55f2a1290f6f6");
|