Commit 95386260 by 徐高华

朋友圈图片url

parent 80b49282
......@@ -207,13 +207,23 @@ public class MaterialServiceImpl implements MaterialService {
if(from == 2) {
url = entity.getImgUrl() ;
}
String[] arr = url.split("/");
String[] arr = null ;
if(url.contains("?")) {
arr = url.split("?")[0].split("/") ;
}else {
arr = url.split("/");
}
int count = arr.length;
if(from==2) {
// 朋友圈上传接口
if (type == 2) {
url+= "?imageView2/2/w/1440/h/1080" ;
if(url.contains("?")) {
}else {
url+= "?imageView2/2/w/1440/h/1080" ;
}
}
logger.info("url={}",url);
jp = qywxSuiteApiService.uploadAttachment(qwDTO.getThirdCorpid(), config.getWxSuiteid(), CommonUtil.getFileByte(url), arr[count - 1], fileType.getCode());
}else {
// 群发上传
......
......@@ -26,9 +26,14 @@ public class CommonUtil {
try (InputStream in = new URL(url).openStream()) {
return IOUtils.toByteArray(in);
} catch (Exception e) {
logger.info("【异常】" + e.getMessage(), e);
logger.info("【异常】{} ,{},{}" , e.getMessage(), e , url);
}
return null;
}
public static void main(String[] args) {
getFileByte("https://jhdm-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-cce7cc3de0bf48cebf16fb5c65f4ae9c.jpg?imageView2/format/jpg/q/50?imageView2/2/w/1440/h/1080") ;
System.out.println(1);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment