智慧保安后台管理-外网项目备份
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -225,8 +225,8 @@
            in, in.available(), -1)
            .headers(headers)
            .build());
      InputStream inputStream = file.getInputStream();
      FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//      InputStream inputStream = file.getInputStream();
//      FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
      in.close();
      String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
      //数据封装
@@ -277,8 +277,8 @@
            in, in.available(), -1)
            .headers(headers)
            .build());
      InputStream inputStream = file.getInputStream();
      FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//      InputStream inputStream = file.getInputStream();
//      FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
      in.close();
      String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
      return R.data(urls);
@@ -324,8 +324,8 @@
            in, in.available(), -1)
            .headers(headers)
            .build());
      InputStream inputStream = file.getInputStream();
      FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//      InputStream inputStream = file.getInputStream();
//      FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
      in.close();
      String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
      //数据封装
@@ -434,13 +434,15 @@
               //内网数据推送
               //数据推送
               String s = "update blade_user set avatar = " + "'" + inUrl + "'" + "where id = " + "'" + user.getId() + "'";
               String s = "update blade_user set avatar = " + "'" + inUrl +
                  ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" +
                  "'" + "where id = " + "'" + user.getId() + "'";
               //FtpUtil.sqlFileUpload(s);
               myAsyncService.FTP(s);
               myAsyncService.dataSync(s);
               //文件推送
               InputStream inputStream = multipartFile.getInputStream();
               FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//               InputStream inputStream = multipartFile.getInputStream();
//               FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
               in.close();
            }
         }
@@ -559,11 +561,11 @@
                  "," + "'" + examPayment.getPaymentStatus() + "'" +
                  "," +"'" + inUrl + "'" + ")";
               //FtpUtil.sqlFileUpload(s);
               myAsyncService.FTP(s);
               myAsyncService.dataSync(s);
               //文件推送
               InputStream inputStream = multipartFile.getInputStream();
               FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//               InputStream inputStream = multipartFile.getInputStream();
//               FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
               in.close();
            }
         }
@@ -619,8 +621,8 @@
            .build());
      //文件推送
      InputStream inputStream = file.getInputStream();
      FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//      InputStream inputStream = file.getInputStream();
//      FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
      in.close();
      String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
      //数据封装
@@ -756,7 +758,7 @@
         s1 += ")";
      }
      //FtpUtil.sqlFileUpload(s1);
      myAsyncService.FTP(s1);
      myAsyncService.dataSync(s1);
      return attach.getId();
   }