|
@@ -1,5 +1,6 @@
|
|
|
package com.gree.mall.miniapp.config;
|
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
@@ -9,13 +10,19 @@ import javax.servlet.MultipartConfigElement;
|
|
|
@Configuration
|
|
|
public class MulitpartConfig {
|
|
|
|
|
|
+ @Value("${spring.profiles.active}")
|
|
|
+ private String env;
|
|
|
/**
|
|
|
* 文件上传临时路径
|
|
|
*/
|
|
|
@Bean
|
|
|
MultipartConfigElement multipartConfigElement() {
|
|
|
MultipartConfigFactory factory = new MultipartConfigFactory();
|
|
|
- factory.setLocation("/app");
|
|
|
+ if (env.equals("prd")) {
|
|
|
+ factory.setLocation("/home/jsmapp");
|
|
|
+ } else {
|
|
|
+ factory.setLocation("/app");
|
|
|
+ }
|
|
|
return factory.createMultipartConfig();
|
|
|
}
|
|
|
|