Procházet zdrojové kódy

二维码加头像

xiongzhu před 5 roky
rodič
revize
eefd4e3cce

+ 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 {
         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);
             user.setShareImg(url);
             userRepo.save(user);
@@ -521,6 +521,6 @@ public class UserService {
                 .outputFormat("jpg")
                 .toOutputStream(out);
         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-        return storageService.uploadFromInputStream(in, "share_img/v1/" + userId + ".jpg");
+        return storageService.uploadFromInputStream(in, "share_img/v2/" + userId + ".jpg");
     }
 }