فهرست منبع

二维码加头像

xiongzhu 5 سال پیش
والد
کامیت
eefd4e3cce
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/main/java/com/izouma/jiashanxia/service/UserService.java

+ 2 - 2
src/main/java/com/izouma/jiashanxia/service/UserService.java

@@ -471,7 +471,7 @@ public class UserService {
 
 
     public String shareImg(Long userId) throws IOException, WxErrorException {
     public String shareImg(Long userId) throws IOException, WxErrorException {
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
-        if (!(StringUtils.isNotEmpty(user.getShareImg()) && user.getShareImg().contains("/v1/"))) {
+        if (!(StringUtils.isNotEmpty(user.getShareImg()) && user.getShareImg().contains("/v2/"))) {
             String url = createShareImg(userId);
             String url = createShareImg(userId);
             user.setShareImg(url);
             user.setShareImg(url);
             userRepo.save(user);
             userRepo.save(user);
@@ -521,6 +521,6 @@ public class UserService {
                 .outputFormat("jpg")
                 .outputFormat("jpg")
                 .toOutputStream(out);
                 .toOutputStream(out);
         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-        return storageService.uploadFromInputStream(in, "share_img/v1/" + userId + ".jpg");
+        return storageService.uploadFromInputStream(in, "share_img/v2/" + userId + ".jpg");
     }
     }
 }
 }