yumeng 5 éve
szülő
commit
1dacc1439b

+ 0 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/JeecgApplication.java

@@ -5,18 +5,15 @@ import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.web.servlet.MultipartConfigFactory;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Import;
 import org.springframework.core.env.Environment;
-import org.springframework.util.unit.DataSize;
 import org.springframework.web.client.RestTemplate;
 import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
-import javax.servlet.MultipartConfigElement;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
@@ -52,16 +49,5 @@ public class JeecgApplication {
         return new PaginationInterceptor();
     }
 
-    @Bean
-    public MultipartConfigElement multipartConfigElement() {
-        MultipartConfigFactory factory = new MultipartConfigFactory();
-        //单个文件大小200MB,单位KB,MB
-        factory.setMaxFileSize(DataSize.parse("200MB"));
-        //设置总上传数据大小200MB,单位KB,MB
-        factory.setMaxRequestSize(DataSize.parse("200MB"));
-
-        return factory.createMultipartConfig();
-    }
-
 
 }

+ 3 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouMaterialUploadServiceImpl.java

@@ -58,9 +58,8 @@ public class KuaiShouMaterialUploadServiceImpl implements IKuaiShouMaterialUploa
         JSONObject returnJson = new JSONObject();
         try {
             String requestUrl = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.VIDEO_UPLOAD;
-            String downloadUrl = url.replace(replaceOldValue, replaceValue);
-            log.info("replaceUrl:{}", url);
-            String localUrl = LoadFileUtil.downLoadFromUrl(url, downloadUrl);
+            String videoUrl = url.replace(replaceOldValue, replaceValue);
+            String localUrl = LoadFileUtil.downLoadFromUrl(videoUrl, downloadUrl);
             File file = new File(localUrl);
             FileSystemResource resource = new FileSystemResource(file);
             Map<String, String> headerMap = new HashMap<>();
@@ -92,6 +91,7 @@ public class KuaiShouMaterialUploadServiceImpl implements IKuaiShouMaterialUploa
                         returnJson.put("message", "上传成功");
 
                     }
+                    LoadFileUtil.delFile(localUrl);
                     log.info("快手素材上传完成,accountId:{},code:{},返回信息:{}", accountId, signature, resultJson);
                 } else {
                     log.error("快手上传素材失败,返回信息:{},请求参数:{}", resultJson, requestJson);