Closed 510mt closed 5 years ago
else if (httpRequest.getContentType() == HttpContentType.MULTIPART_FORM_DATA) {
HashMap<String, File> imageList = httpRequest.getImageList();
Map<String, Object> params = httpRequest.getParams();
MultipartBuilder multipartBuilder = new MultipartBuilder();
//修复腾讯sdk byte[]报错的bug
if (httpRequest.getBytesContentList() != null) {
imageList = new HashMap<>();
}
try {
setMultiPartEntity(multipartBuilder, params, imageList, httpRequest.getBytesContentList());
} catch (FileNotFoundException e) {
throw new ParamException(e.getMessage());
}
加一个判断就可以了,这个bug有点蛋疼,这个本人自己将sdk封装spring-boot-starter
封装的腾讯sdk接口
调用FaceIdentifyRequest并传入的是byte的图片文件时
定位到com.qcloud.image.op.DetectionOp这个类下,发现了未对byte[]类型的文件进行判断(url以及file形式的参数进行了判断)
错误定位到com.qcloud.image.http.DefaultImageHttpClient 这个位置的sendPostRequest方法,这里把空的file传入到一个hashmap中,并作为参数设值到了httpRequest中,执行httpClient.sendHttpRequest(httpRequest)这个方法进入到com.qcloud.image.http.AbstractImageHttpClient这个类
执行
执行sendPostRequest(httpRequest)定位到com.qcloud.image.http.DefaultImageHttpClient这个类
在这个类中,因为前面hashmap传入了一个空的file,导致size>0,并引发了
这个错误。
@@以上就是遇到的问题,还希望能把后台界面完善下,我上传person的信息,还有我组的相关信息,但是后台都看不到,这个问题很蛋疼,麻烦能关注下这个点。