Commit 13e4e9b0 13e4e9b0a50bdb08cb7997d70acf7798ab6f3672 by xianghan

1.关注时调用uc-service的解析微信头像接口

1 parent 50436f0d
...@@ -474,8 +474,7 @@ public class UserOperationController { ...@@ -474,8 +474,7 @@ public class UserOperationController {
474 474
475 if (StringUtils.isNotBlank(headimgurl)) { 475 if (StringUtils.isNotBlank(headimgurl)) {
476 String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8"); 476 String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8");
477 String imageEncode = Base64Util.encode(headimgurlDecode); 477 String image = RestTemplateClient.netImage(headimgurlDecode);
478 String image = RestTemplateClient.chooseImage(imageEncode, "image");
479 memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) == true ? image:headimgurlDecode); 478 memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) == true ? image:headimgurlDecode);
480 } 479 }
481 }catch (Exception e) { 480 }catch (Exception e) {
......
...@@ -42,10 +42,10 @@ public class RestTemplateClient { ...@@ -42,10 +42,10 @@ public class RestTemplateClient {
42 restTemplate = new RestTemplate(factory); 42 restTemplate = new RestTemplate(factory);
43 } 43 }
44 44
45 public static String chooseImage(String base64Url, String entity) { 45 public static String netImage(String imageUrl) {
46 Image image = new Image(base64Url, entity); 46 Image image = new Image(imageUrl);
47 String entityBody = ""; 47 String entityBody = "";
48 String url = BASE_URL + "/ucService/api/upload/chooseImage"; 48 String url = BASE_URL + "/ucService/api/upload/netImage";
49 log.info("request uc : url is " + url + ", memberId is " + com.alibaba.fastjson.JSONObject.toJSONString(image)); 49 log.info("request uc : url is " + url + ", memberId is " + com.alibaba.fastjson.JSONObject.toJSONString(image));
50 ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, image, String.class); 50 ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, image, String.class);
51 if (responseEntity.getStatusCode().is2xxSuccessful()) { 51 if (responseEntity.getStatusCode().is2xxSuccessful()) {
...@@ -61,12 +61,10 @@ public class RestTemplateClient { ...@@ -61,12 +61,10 @@ public class RestTemplateClient {
61 @Data 61 @Data
62 static class Image { 62 static class Image {
63 63
64 private String base64URL; 64 private String url;
65 private String entity;
66 65
67 public Image(String base64Url, String entity){ 66 public Image(String imageUrl){
68 this.base64URL = base64Url; 67 this.url = imageUrl;
69 this.entity = entity;
70 } 68 }
71 69
72 } 70 }
......