licailing 4 years ago
parent
commit
68f40e3b55
1 changed files with 8 additions and 7 deletions
  1. 8 7
      src/main/java/com/izouma/jiashanxia/service/UserService.java

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

@@ -600,13 +600,14 @@ public class UserService {
     }
 
     public String shareImg(Long userId) throws IOException, WxErrorException {
-        User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
-        if (!(StringUtils.isNotEmpty(user.getShareImg()) && user.getShareImg().contains("/v2/"))) {
-            String url = this.createShareImg2(userId, false, null, "share_img/v2/");
-            user.setShareImg(url);
-            userRepo.save(user);
-        }
-        return user.getShareImg();
+//        User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
+//        if (!(StringUtils.isNotEmpty(user.getShareImg()) && user.getShareImg().contains("/v2/"))) {
+//            String url = this.createShareImg2(userId, false, null, "share_img/v2/");
+//            user.setShareImg(url);
+//            userRepo.save(user);
+//        }
+//        return user.getShareImg();
+        return this.createShareImg2(userId, false, null, "share_img/v2/");
     }
 
     public String createShareImg(Long userId) throws IOException, WxErrorException {