瀏覽代碼

logo上传方式改为复制

dengsixing 1 年之前
父節點
當前提交
144a2f0605
共有 1 個文件被更改,包括 10 次插入8 次删除
  1. 10 8
      src/main/java/com/fdkankan/contro/service/impl/CommonServiceImpl.java

+ 10 - 8
src/main/java/com/fdkankan/contro/service/impl/CommonServiceImpl.java

@@ -443,20 +443,22 @@ public class CommonServiceImpl implements ICommonService {
             String userEditPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
             String localLogoPath = null;
             if (StrUtil.isNotEmpty(company.getTopLogo())) {
-                localLogoPath = ConstantFilePath.AGENT_PATH + company.getTopLogo().substring(company.getTopLogo().lastIndexOf("//") + 1);
-                HttpUtil.downloadFile(company.getTopLogo(), localLogoPath);
-                fYunFileServiceInterface.uploadFile(localLogoPath, userViewPath + "loadingLogo-user.png");
-                fYunFileServiceInterface.uploadFile(localLogoPath, userEditPath + "loadingLogo-user.png");
+                String logoKey = company.getTopLogo().replace(fYunFileConfig.getHost(), "");
+                fYunFileServiceInterface.copyFileInBucket(logoKey, userViewPath + "loadingLogo-user.png");
+                fYunFileServiceInterface.copyFileInBucket(logoKey, userEditPath + "loadingLogo-user.png");
                 sceneJson.setLoadingLogo("user");
                 sceneJson.setLoadingLogoFile("loadingLogo-user.png");
                 sceneEditInfo.setLoadingLogo("user");
                 sceneEditInfo.setLoadingLogoFile("loadingLogo-user.png");
             }
             if (StrUtil.isNotEmpty(company.getFloorLogo())) {
-                localLogoPath = ConstantFilePath.AGENT_PATH + company.getFloorLogo().substring(company.getFloorLogo().lastIndexOf("//") + 1);
-                HttpUtil.downloadFile(company.getFloorLogo(), localLogoPath);
-                fYunFileServiceInterface.uploadFile(localLogoPath, userViewPath + "floorLogo-user.png");
-                fYunFileServiceInterface.uploadFile(localLogoPath, userEditPath + "floorLogo-user.png");
+//                localLogoPath = ConstantFilePath.AGENT_PATH + company.getFloorLogo().substring(company.getFloorLogo().lastIndexOf("//") + 1);
+//                HttpUtil.downloadFile(company.getFloorLogo(), localLogoPath);
+//                fYunFileServiceInterface.uploadFile(localLogoPath, userViewPath + "floorLogo-user.png");
+//                fYunFileServiceInterface.uploadFile(localLogoPath, userEditPath + "floorLogo-user.png");
+                String logoKey = company.getFloorLogo().replace(fYunFileConfig.getHost(), "");
+                fYunFileServiceInterface.copyFileInBucket(logoKey, userViewPath + "floorLogo-user.png");
+                fYunFileServiceInterface.copyFileInBucket(logoKey, userEditPath + "floorLogo-user.png");
                 sceneJson.setFloorLogo("user");
                 sceneJson.setFloorLogoFile("floorLogo-user.png");