Commit e200f65a by fudahua

图片内容

parent 911d6074
...@@ -9,6 +9,7 @@ import java.util.stream.Collectors; ...@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.GlobalInfo; import com.gic.commons.util.GlobalInfo;
import com.gic.commons.util.GlobalVar; import com.gic.commons.util.GlobalVar;
import com.gic.commons.util.ImageUtil;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.SecretTypeEnum; import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.DepartmentApiService; import com.gic.haoban.manage.api.service.DepartmentApiService;
...@@ -1340,9 +1341,10 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1340,9 +1341,10 @@ public class StaffApiServiceImpl implements StaffApiService {
private String changeHeaderImageUrl(String headImgUrl) { private String changeHeaderImageUrl(String headImgUrl) {
// InputStream in = new URL(headImgUrl).openStream();
try { try {
InputStream in = new URL(headImgUrl).openStream(); byte[] data = ImageUtil.getImgbyte(headImgUrl);
byte[] data = IOUtils.toByteArray(in); // byte[] data = IOUtils.toByteArray(in);
PicUploadResDTO uploadPic = qqCloudPicService.uploadPic(GlobalVar.ctxPropertiesMap.get(GlobalInfo.QQPIC_KEY_ENTERPRISE), data); PicUploadResDTO uploadPic = qqCloudPicService.uploadPic(GlobalVar.ctxPropertiesMap.get(GlobalInfo.QQPIC_KEY_ENTERPRISE), data);
logger.info("腾讯云万象优图返回" + JSON.toJSONString(uploadPic)); logger.info("腾讯云万象优图返回" + JSON.toJSONString(uploadPic));
return uploadPic.downloadUrl; return uploadPic.downloadUrl;
......
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